A webpack plugin that compiles Nunjucks templates at build time. Version 5.0.0 (2018-11-12) supports webpack 2, 3, and 4, and drops Node.js 4. It renders .njk files with optional per-template context and writes outputs as webpack assets. Key differentiator: exposes webpack compilation hash (e.g., for cache busting) via __webpack__.hash in templates. Uses nunjucks ^3.0.0 as a peer dependency. Release cadence is low—last release was 2018; development appears inactive.
npm install nunjucks-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Basic setup: compile a single Nunjucks template to an HTML output file via webpack.
Use `templates: [{ from: ..., to: ... }]` instead of `template: { from: ..., to: ... }`.Use `writeToFileEmit: true` instead of `writeToFileWhenMemoryFs: true`.
Upgrade to webpack 2, 3, or 4.
Use Node.js >= 6.9.0.
Set `writeToFileEmit: true` per template to force writing to disk in memory-fs environments.
Consider migrating to an actively maintained alternative (e.g., manually using nunjucks in a webpack loader).
Run 'npm install --save-dev nunjucks-webpack-plugin'.
Wrap the template object in an array: `templates: [{ from: '...', to: '...' }]`.Rename `template` to `templates` and ensure it is an array.
No dependency data recorded yet.