-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from Thomascogez/feature/replace-html-minifie…
…r-with-htmlnano Feature/replace html minifier with htmlnano
- Loading branch information
Showing
11 changed files
with
9,491 additions
and
3,880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Migration Guide from 1.3.x to 1.4.0 | ||
|
||
## Breaking Changes | ||
- `html-minifier` has been removed from the dependencies and it's now replaced by `htmlnano` (as a peer dependency) (reported by #268). | ||
- The `minifyHtmlOutput` is now `false` by default, since `htmlnano` require a bit more configuration to work properly. | ||
- The `htmlMinifierOptions` as been rename to `templateMinifierOptions` and it's now an object with the following properties: | ||
- `options`: (optional) Wich is the options object passed to `htmlnano`. | ||
- `preset`: (optional) Which is the preset used by `htmlnano`. | ||
|
||
## How to migrate | ||
|
||
### 1. Update the `nodemailer-mjml` version | ||
|
||
```bash | ||
npm install nodemailer-mjml@latest | ||
or | ||
yarn add nodemailer-mjml@latest | ||
``` | ||
### 2. If you where using minifyHtmlOutput, you will need to enable it explicitly in the options | ||
|
||
### 3. Install `htmlnano` dependency (as a dev dependency) | ||
|
||
```bash | ||
npm install --save-dev htmlnano | ||
or | ||
yarn add -D htmlnano | ||
``` | ||
> [!NOTE] | ||
> If you want `html` minification, you will need to also install `posthtml` <br> | ||
> If you want `html` minification, you will need to also install `postcss` and `cssnano` <br> | ||
> If you want `js` minification, you will need to also install `terser` <br> | ||
> If you want `svg` minification, you will need to also install `svgo` | ||
More information about the `htmlnano` options can be found [here](https://htmlnano.netlify.app/). | ||
‡ | ||
### 4. Update the plugin options by removing `htmlMinifierOptions` and adding `templateMinifierOptions` with your desired options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4,056 changes: 796 additions & 3,260 deletions
4,056
__tests__/unit/__snapshots__/template_render.spec.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.