nunjucks-loader
nunjucks-loader copied to clipboard
How to pass custom variables into loader in webpack config file?
Actually, i want to achieve
njk file -> nunjucks-loader (with custom variables) -> html file
all of this happens in webpack config file.
the output of HTML files will be generated directly after webpack has compiled them.
but not the way you did in the entry.js
, that jquery append the html string into the body tag.
A good example of the idea would be the ejs-loader
: https://github.com/okonet/ejs-loader#options
which let the users to pass variables by defining it in query
I don't know how to achieve this, or it's not possible at present?
Thanks in advance!
I'm not sure how that would/could look with child/parent dependencies (particularly resolving the parents from the children).
Can you give me some more info on what you're wanting to achieve? Eg.Do you need to change the include path / filters etc for each template?