mikel-webpack-plugin
v0.14.1
Published
Generate HTML files using the Mikel templating
Downloads
71
Maintainers
Readme
Mikel Webpack Plugin
Generate HTML files using the Mikel templating.
Description
A Webpack plugin inspired by htmlWebpackPlugin that generates HTML files for your bundles using Mikel as the templating engine.
Installation
Install this project using npm:
$ npm install --save-dev mikel-webpack-plugin
Or using yarn:
$ yarn add --dev mikel-webpack-plugin
Usage
// webpack.config.js
import MikelWebpackPlugin from "mikel-webpack-plugin";
export default {
entry: "index.js",
output: {
path: path.join(process.cwd(), "www"),
filename: "bundle.js",
},
plugins: [
new MikelWebpackPlugin({
filename: "index.html",
}),
],
};
Configuration
This plugin accepts the following options:
| Name | Type | Description | Default Value |
|------|------|-------------|---------------|
| filename
| String
| Name of the generated HTML file. | index.html
|
| template
| String
| Absolute path to the template file to use. | null
|
| templateContent
| String
| Template content as a string. | null
|
| chunks
| Array
| List of entry names to include in the HTML. | ["main"]
|
| publicPath
| String
| Public path for the assets. | "./"
|
| templateData
| Object
| Additional data for the template that will be passes to Mikel. | {}
|
| templateOptions
| Object
| Additional options for the Mikel templating (partials, helpers, and functions). | {}
|
License
This project is licensed under the MIT License.