-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
File does not render correctly / cannot get variable from options #1839
Comments
Please create reproducible test repo using github, thank you |
Please see reproducible test repo as requested https://github.com/mateusz-grek/html-webpack-plugin-issue |
Because html-loader doesn't support variables, it is a future of html-webpack-plugin, you need to pass variables into There is an old issue - webpack-contrib/html-loader#291, I recommend to use template engine for such purposes, we are still not sure it is a right solution to allow using |
Current behaviour 💣
I currently have the following file structure: emodelle.html located in the de folder takes the element from de/components/02_footer_section/index.html and injects its contents into itself.
de/emodelle.html
de/components/02_footer_section/index.html
This dynamic variable
newVariable
comes from webpack.config.jsWebpack.config.js
Expected behaviour ☀️
When using the
npm run dev
command, thenewVariable
variable appears correctly from emodelle.html, but not from footer, but when I go directly to the footer file in the browser, I see the rendered variable.It seems that when compiling, webpack only renders emodelle and takes its variables, while from footer it does not render anything, it only shows pure html as a string in emodelle.html
GOAL TO ACHIEVE
I would like to be able to add dynamic variables to the file de/components/02_footer_section/index.html which will then be rendered when compiling to emodelle.html
Reproduction Example 👾
Environment 🖥
The text was updated successfully, but these errors were encountered: