2.1.3 • Published 5 months ago

webpack-mjml-plugin v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Installation :gift:

npm install webpack-mjml-plugin

Usage :joystick:

In your webpack.config.js simply:

const MJMLPlugin = require('webpack-mjml-plugin');

module.exports = {
  // ...
  plugins: [
    new MJMLPlugin('src/to/mjml/*.mjml', {
      extension: '.html',
      outputPath: path.resolve(__dirname, 'dist/to/mjml')
    });
  ]
};

API :bee:

The plugin supports all options that can be found in this documentation.

// webpack.config.js

module.exports = {
  plugins: [
    new MJMLPlugin(inputPath, {
      extension: options.extension,
      outputPath: options.outputPath,
      // MJML options (https://documentation.mjml.io/#inside-node-js)
      filePath: path.resolve(__dirname, 'src/to/mjml'),
      keepComments: false
    })
  ]
};

In addition to the options available in the MJML documentation, there are 3 additional parameters described in the table below:

ParameterTypeDefaultDescription
inputPathstringundefinedThe path where .mjml files are located. The string supports glob syntax ex: path/to/mjml/**/*.mjml
options.extensionsstring.htmlThe default output extension.
options.outputPathstringprocess.cwd()The path where compiled files should be written to.

Contributing :busts_in_silhouette:

Please read CONTRIBUTING.md for details on code of conduct, and the process for submitting pull requests.

License :balance_scale:

Webpack MJML Plugin is licensed under the MIT License - see the LICENSE.md file for details.

2.1.3

5 months ago

2.1.2

7 months ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago