Skip to content
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

Do not URL encode chunkFile name #1771

Open
weiwei-lin opened this issue Nov 2, 2022 · 1 comment
Open

Do not URL encode chunkFile name #1771

weiwei-lin opened this issue Nov 2, 2022 · 1 comment

Comments

@weiwei-lin
Copy link

Current behaviour 💣

Chunk file name is URL encoded.

Expected behaviour ☀️

Chunk file name should not be URL encoded.

Reproduction Example 👾

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants