-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
About v5 version js will be inserted in front of css by default #1782
Comments
We find that in this case, js will execute parsing earlier than css, which is particularly obvious when js reads from memory |
Thank you very much. I will consider your proposal |
Hello, when we upgraded from v4 to v5, we found that the default location for inserting js has changed. Can you tell me why this change was made
v4:
v5:
webpack config:
`const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: "production",
entry: ["./src/index.js"],
output: {
filename: "[name].[hash:8].js",
clean: true,
},
module: {
rules: [
{
test: /.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"],
exclude: /node_modules/,
},
{
test: /.js$/,
use: ["babel-loader"],
exclude: /node_modules/,
},
],
},
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\/]node_modules[\/]/,
name: "vendors",
chunks: "all",
},
},
},
},
plugins: [
new HtmlWebpackPlugin(),
new MiniCssExtractPlugin(),
],
};
`
The text was updated successfully, but these errors were encountered: