We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
splitChunks
Full reduced test case: https://github.com/OliverJAsh/webpack-flush-chunks-webpack-v5-bug
package.json:
package.json
{ "dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2", "webpack": "^5.58.0", "webpack-cli": "^4.9.0", "webpack-flush-chunks": "^2.0.3" } }
webpack.config.js:
webpack.config.js
module.exports = { mode: "production", entry: "./src/entry.js", optimization: { chunkIds: 'named', } };
src/entry.js:
src/entry.js
import(/* webpackChunkName: "routeA" */ './routeA') import(/* webpackChunkName: "routeB" */ './routeB')
src/routeA.js:
src/routeA.js
import React from 'react'; import ReactDOM from 'react-dom'; React; ReactDOM;
src/routeB.js:
src/routeB.js
test.js:
test.js
const flushChunks = require("webpack-flush-chunks").default; const stats = require("./stats.json"); const result = flushChunks(stats, { chunkNames: ["routeA"] }); console.log(result.scripts);
Run these commands:
rm -rf dist webpack --json=stats.json node test.js
Expected result:
[ 'routeA.js', 'main.js' ]
Actual result:
[ 'vendors-node_modules_react-dom_index_js.js', 'routeA.js', 'main.js' ]
The text was updated successfully, but these errors were encountered:
stats.chunks
Successfully merging a pull request may close this issue.
Full reduced test case: https://github.com/OliverJAsh/webpack-flush-chunks-webpack-v5-bug
package.json
:webpack.config.js
:src/entry.js
:src/routeA.js
:src/routeB.js
:test.js
:Run these commands:
Expected result:
Actual result:
The text was updated successfully, but these errors were encountered: