nunjucks-loader icon indicating copy to clipboard operation
nunjucks-loader copied to clipboard

How to pass custom variables into loader in webpack config file?

Open Kaijun opened this issue 8 years ago • 1 comments

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!

Kaijun avatar Aug 19 '16 20:08 Kaijun

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?

at0g avatar Aug 28 '16 09:08 at0g