itgalaxy / nunjucks-webpack-plugin

A webpack plugin for nunjucks.
MIT License
27 stars 12 forks source link
nunjucks webpack webpack-plugin

nunjucks-webpack-plugin

NPM version Travis Build Status devDependencies Status peerDependencies Status Greenkeeper badge

A webpack plugin for nunjucks.

Install

npm install --save-dev nunjucks-webpack-plugin

Usage

import NunjucksWebpackPlugin from "nunjucks-webpack-plugin";

export default {
  plugins: [
    new NunjucksWebpackPlugin({
      templates: [
        {
          from: "/path/to/template.njk",
          to: "template.html"
        }
      ]
    })
  ]
};

It is possible to use multiple templates:

import NunjucksWebpackPlugin from "nunjucks-webpack-plugin";

export default {
  plugins: [
    new NunjucksWebpackPlugin({
      templates: [
        {
          from: "/path/to/template.njk",
          to: "template.html"
        },
        {
          from: "/path/to/next-template.njk",
          to: "next-template.html"
        }
      ]
    })
  ]
};

Options

Contribution

Feel free to push your code if you agree with publishing under the MIT license.

Changelog

License