jantimon / jantimon/html-webpack-plugin

Do not URL encode chunkFile name

Open
#1,771 2 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
JavaScript
Stars
10.7k
Forks
1.3k
Avg merge
1m
Merged PRs (30d)
1

Description

## Current behaviour 💣

Chunk file name is URL encoded.

## Expected behaviour ☀️

Chunk file name should not be URL encoded.

### Reproduction Example 👾

```javascript
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
entry: {
"@app": "./index.js"
},
plugins: [
new HtmlWebpackPlugin({
template: "./src/template.ejs"
})
]
};
```

### Explanation

This is effectively a reversal of #1254 and #1257
This is desired because webpack and other plugins (e.g. workbox) doesn't do the encoding.
If html-webpack-plugin does the encoding, it could break other plugins.
For instance, when the backend server or server worker (e.g. one generated by workbox) is serving the generated JS files, it won't necessarily decode the URL before serving the file.
Since all npm packages have URL-safe names, I think it should be up to the users to ensure the entries are URL safe rather than letting the plugin does the encoding automatically.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided webpack.config.js entry using the "@app" name and the src/template.ejs setup, then trace how the plugin produces the chunk file name. Confirm that generated JavaScript chunk names remain unencoded and verify the result with the webpack configuration and related plugin behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.