jantimon / jantimon/html-webpack-plugin
[locale] variable in filenames mangled to [locale:b64b2e3f] when using tag from another plugin
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.3k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
## Current behaviour 💣
When using https://github.com/privatenumber/webpack-localize-assets-plugin it is recommended to insert [locale] inside filenames so that when building multiple locale files, it can be exchanged for the correct value (en, ko, es, en-US, and all those).
Recently after a version update to the latest, [locale] no longer gets left alone for the plugin to pick it up. Instead it outputs [locale:b64b2e3f] in its place, which then throws off the plugin that is expecting it.
It is possible that i misunderstand what the b64b2e3f signifies, and maybe it is predictable in a way that can differentiate en/ko/es and so on.
It is also possible that this isn't a behavior change in the html webpack plugin, but i am getting the asset list from the .beforeAssetTagGeneration.tapAsync tap, and the files are already replaced with locale:b64b2e3f and url encoded, where as before they were set to the proper locale string.
## Expected behaviour ☀️
I would expect that html webpack plugin would not alter the [locale] tag.
### Reproduction Example 👾
const config = {
output: {
filename: '[name].[locale].js'
},
plugins: [
new LocalizeAssetsPlugin({ locales }), //Plugin that needs locales unmodified
new HtmlWebpackPlugin(), //Our favourite html plugin
],
}
## Environment 🖥
```
Node.js v16.15.0
linux 5.10.0-14-amd64
npm 8.5.5
```
Its also worth mentioning that this issue has been posted on the plugins issues as well, but it does seem that the issue is lower than the locale plugin can go. https://github.com/privatenumber/webpack-localize-assets-plugin/issues/17
Thanks for reading.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the reproduction using output.filename '[name].[locale].js', LocalizeAssetsPlugin, and HtmlWebpackPlugin. Inspect the asset list received by the beforeAssetTagGeneration.tapAsync hook and compare how [locale] is represented before and after the relevant update; done means the tag remains usable by the localization plugin without becoming [locale:b64b2e3f].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100