All Projects → itgalaxy → nunjucks-webpack-plugin

itgalaxy / nunjucks-webpack-plugin

Licence: MIT license
A webpack plugin for nunjucks.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to nunjucks-webpack-plugin

Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+7488.89%)
Mutual labels:  webpack-plugin
Preload Webpack Plugin
Please use https://github.com/vuejs/preload-webpack-plugin instead.
Stars: ✭ 2,174 (+7951.85%)
Mutual labels:  webpack-plugin
Hard Source Webpack Plugin
www.npmjs.com/package/hard-source-webpack-plugin
Stars: ✭ 2,608 (+9559.26%)
Mutual labels:  webpack-plugin
React Core Boilerplate
Powerful ASP.NET Core 3 templates with React, true server-side rendering and Docker support
Stars: ✭ 169 (+525.93%)
Mutual labels:  webpack-plugin
Emojify Webpack Plugin
🦄 Turn your code into emoji
Stars: ✭ 178 (+559.26%)
Mutual labels:  webpack-plugin
Bundle Buddy Webpack Plugin
🐐🐐🐐🐐 bundle-buddy-webpack-plugin 🐐🐐🐐🐐
Stars: ✭ 199 (+637.04%)
Mutual labels:  webpack-plugin
Optimize Js Plugin
Webpack plugin to optimize a JavaScript file for faster initial load by wrapping eagerly-invoked functions.
Stars: ✭ 163 (+503.7%)
Mutual labels:  webpack-plugin
Webpack Messages
Beautifully format Webpack messages throughout your bundle lifecycle(s)!
Stars: ✭ 238 (+781.48%)
Mutual labels:  webpack-plugin
Wxapp Webpack Plugin
📦 微信小程序 webpack 插件
Stars: ✭ 185 (+585.19%)
Mutual labels:  webpack-plugin
Page Skeleton Webpack Plugin
Webpack plugin to generate the skeleton page automatically
Stars: ✭ 2,632 (+9648.15%)
Mutual labels:  webpack-plugin
Html Res Webpack Plugin
plugin for generating html in webpack
Stars: ✭ 170 (+529.63%)
Mutual labels:  webpack-plugin
Antd Scss Theme Plugin
A Webpack plugin for customizing Ant Design with an SCSS theme file and using Ant Design's compiled variables in SCSS files throughout your project.
Stars: ✭ 176 (+551.85%)
Mutual labels:  webpack-plugin
Unused Files Webpack Plugin
Glob all files that are not compiled by webpack under webpack's context
Stars: ✭ 210 (+677.78%)
Mutual labels:  webpack-plugin
Multipage Webpack Plugin
A plugin that makes handling templates and asset distribution for multi-page applications using webpack trivial
Stars: ✭ 168 (+522.22%)
Mutual labels:  webpack-plugin
Critters
🦔 A Webpack plugin to inline your critical CSS and lazy-load the rest.
Stars: ✭ 2,894 (+10618.52%)
Mutual labels:  webpack-plugin
Virtual Module Webpack Plugin
Adds the contents of a virtual file to webpack's cached file system without writing it to disk
Stars: ✭ 165 (+511.11%)
Mutual labels:  webpack-plugin
Vue Auto Routing
Generate Vue Router routing automatically
Stars: ✭ 196 (+625.93%)
Mutual labels:  webpack-plugin
Webpack Shell Plugin
Run shell commands either before or after webpack builds
Stars: ✭ 250 (+825.93%)
Mutual labels:  webpack-plugin
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+9822.22%)
Mutual labels:  webpack-plugin
Antd Dayjs Webpack Plugin
⏰ Day.js webpack plugin for antd
Stars: ✭ 215 (+696.3%)
Mutual labels:  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

  • templates - (require) array list of templates.

    • from - (require) string path to template.

    • to - (require) string destination path include filename and extension (relative output webpack option).

    • context - (optional) instead global context (see above), see render second argument. The following webpack compilation variables are also sent through to the template under the __webpack__ object:

      • hash
    • callback - (optional) instead global callback (see above), see render third argument.

    • writeToFileEmit - (optional, default: false) - If set to true will emit to build folder and memory in combination with webpack-dev-server

  • configure - (optional) object or nunjucks.Environment see configure options.

Contribution

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

Changelog

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].