Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kaijun opened this issue Aug 19, 2016 · 1 comment
Open

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

Kaijun opened this issue Aug 19, 2016 · 1 comment

Comments

@Kaijun
Copy link

Kaijun commented Aug 19, 2016

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 Kaijun changed the title How to pass custom variables in to loader in webpack config file? How to pass custom variables into loader in webpack config file? Aug 19, 2016
@at0g
Copy link
Owner

at0g commented Aug 28, 2016

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants