0.18.1 • Published 4 months ago

mikel-webpack-plugin v0.18.1

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

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:

NameTypeDescriptionDefault Value
filenameStringName of the generated HTML file.index.html
templateStringAbsolute path to the template file to use.null
templateContentStringTemplate content as a string.null
chunksArrayList of entry names to include in the HTML.["main"]
publicPathStringPublic path for the assets."./"
metaObjectAdditional <meta> tags to include in the <head>. Example: {author: "John Doe"}.{}
linkArrayList of <link> tags to include in the <head>. Example: [{rel: "icon", href: "/favicon.ico"}].
templateDataObjectAdditional data for the template that will be passes to Mikel.{}
templateOptionsObjectAdditional options for the Mikel templating (partials, helpers, and functions).{}

License

This project is licensed under the MIT License.

0.18.1

4 months ago

0.17.0

6 months ago

0.16.0

7 months ago

0.15.0

7 months ago

0.14.1

7 months ago