-
-
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
Ver. 5.6.0: Reference to htmlWebpackPlugin.options.filename in template contains "[name]" instead of actual file name #1848
Comments
Can you put your example using github? thank you |
I just published a minimal example at https://github.com/CarlRaymond/html-webpack-plugin-issue1848 with instructions to make it fail and succeed. Thanks! |
I am having the exact same issue. My attempt at a workaround was to provide a function to This leads to something along the lines of not processing the output filename before generating the values being passed to the templateContent function. |
A little bit of research, and this version was the last version that works. |
Sorry, please never rely on |
it works because we don't make it lazy, so contenthash doesn't work properly and invalidation was broken |
Yea, thats cool. Just annoying since the version change between this one and the next is only a patch, but broke some of my code that hasn't changed in like a year. Feels like the 'lazy' part of that is at least a minor change, instead of patch. No worries though, I'll go through and make some changes on my project to handle this without depending on the |
Current behaviour 💣
In version 5.6.0, a reference to
htmlWebpackPlugin.options.filename
within a template file contains the the token[name]
. It has not been replaced with the actual filename. In my case, it is../../Pages/Shared/Bundles/[name].cshtml
Expected behaviour ☀️
In version 5.5.0, the reference has had the
[name]
token replaced with the filename:../../Pages/Shared/Bundles/style.cshtml
Reproduction Example 👾
With version 5.6.0 and the configuration below, webpack generates the files
main.cshtml
,style.cshtml
andvalidation.cshtml
, but they are empty. Reverting to version 5.5.0 produces correct contents.webpack.config.js:
bundletemplate.ejs
Environment 🖥
Node.js v18.16.0
win32 10.0.19045
Waiting for the debugger to disconnect...
9.5.1
[email protected] C:\sandbox\UOE.WebsiteTemplates\content\UOE.Bootstrap5.Razor
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ @webpack-cli/[email protected]
│ │ └── [email protected] deduped
│ ├─┬ @webpack-cli/[email protected]
│ │ └── [email protected] deduped
│ ├─┬ @webpack-cli/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
└─┬ [email protected]
└─┬ [email protected]
└── [email protected] deduped
[email protected] C:\sandbox\UOE.WebsiteTemplates\content\UOE.Bootstrap5.Razor
└── [email protected]
The text was updated successfully, but these errors were encountered: