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

[Webpack 5] Why remove the id of runtime chunk from the entriesPart in JsonpTemplatePlugin #11279

Closed
l5oo00 opened this issue Aug 5, 2020 · 2 comments · Fixed by #11281
Closed

Comments

@l5oo00
Copy link
Contributor

l5oo00 commented Aug 5, 2020

Bug report

Why remove the id of runtime chunk from the entriesPart in JsonpTemplatePlugin

What is the current behavior?

  • ./dist/runtime.js
// ...

/******/ 		var installedChunks = {
/******/ 			666: 0
/******/ 		};

// ...
  • ./dist/main.js
(window["webpackJsonpw5"] = window["webpackJsonpw5"] || []).push([[179],{

/***/ 138:
/***/ (() => {


console.log(1);


/***/ })

},[[138]]]);

If the current behavior is a bug, please provide the steps to reproduce.

  • ./src/index.js
console.log(1);
  • ./webpack.config.js
module.exports = {
    entry: {
        main: './src/index.js'
    },
    optimization: {
        minimize: false,
        runtimeChunk: 'single'
    }
};
  • ./package.json
{
  "devDependencies": {
        "webpack": "5.0.0-beta.23",
        "webpack-cli": "^4.0.0-beta.2"
    },
    "scripts": {
        "build": "webpack --config webpack.config.js",
    }
}

What is the expected behavior?

  • ./dist/runtime.js
// ...

/******/ 		var installedChunks = {
/******/ 			666: 0
/******/ 		};

// ...
  • ./dist/main.js
(window["webpackJsonpw5"] = window["webpackJsonpw5"] || []).push([[179],{

/***/ 138:
/***/ (() => {


console.log(1);


/***/ })

},[[138, 666]]]);

When I use webpack@5.0.0-beta.18 and below versions, the behavior is expected.

Other relevant information:
webpack version:
Node.js version: v13.14.0
Operating System: macOS Catalina 10.15.2

@sokra
Copy link
Member

sokra commented Aug 5, 2020

That was not intended, it's a bug. Do you want to send a PR?

@l5oo00
Copy link
Contributor Author

l5oo00 commented Aug 5, 2020

ok, let me have a try.

sokra added a commit that referenced this issue Aug 6, 2020
fix: add the id of runtime chunk to entryInfo #11279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants