jantimon / jantimon/html-webpack-plugin
Bug with images using dev server
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.3k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
## Current behaviour 💣
Hello! I tried to use [image-minimizer-webpack-plugin](https://webpack.js.org/plugins/image-minimizer-webpack-plugin/) in dev server but there's something strange. I have generators (for `.webp` and `.avif`) and i try to require it in HTML (in my case it is `.pug` but never mind). When i have one require it is ok, but when i have two requires or more - the last one generates image, each previous returns default value (in my case it is `.jpg`).
## Expected behaviour ☀️
All requires will generate expected file independently of count
### Reproduction Example 👾
- [Video demonstration](https://www.youtube.com/watch?v=l1Q6V9ELIdk&ab_channel=VolodymyrDoskochinskiy)
- [Webpack configuration](https://github.com/dx1ded/webpack-mpa/blob/main/webpack.config.js)
## Environment 🖥
- **nodejs** - `v15.9.0`
- **npm** - `v7.6.3`
- **webpack** - `v5.65.0`
- **webpack-cli** - `v4.9.1`
- **webpack-dev-server** - `v4.7.0`
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked webpack.config.js and reproduce the case using webpack-dev-server, image-minimizer-webpack-plugin, and multiple image requires from the Pug HTML entry. Compare single and multiple requires, then verify that every require produces its expected generated image rather than the default .jpg value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs, 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