Name: nunjucks-webpack-plugin
Owner: itgalaxy inc.
Description: A webpack plugin for nunjucks.
Created: 2017-04-06 12:40:05.0
Updated: 2017-12-25 15:57:23.0
Pushed: 2017-11-22 15:53:02.0
Homepage: null
Size: 627
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A webpack plugin for nunjucks.
install --save-dev nunjucks-webpack-plugin
rt NunjucksWebpackPlugin from "nunjucks-webpack-plugin";
rt default {
ugins: [
new NunjucksWebpackPlugin({
templates: [
{
from: "/path/to/template.njk",
to: "template.html"
}
]
})
It is possible to use multiple templates:
rt NunjucksWebpackPlugin from "nunjucks-webpack-plugin";
rt default {
ugins: [
new NunjucksWebpackPlugin({
templates: [
{
from: "/path/to/template.njk",
to: "template.html"
},
{
from: "/path/to/next-template.njk",
to: "next-template.html"
}
]
})
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.
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.
Feel free to push your code if you agree with publishing under the MIT license.