jantimon / jantimon/html-webpack-plugin
About v5 version js will be inserted in front of css by default
- Dominant language
- JavaScript
- Stars
- 10.7k
- Forks
- 1.3k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
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(),
],
};
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the provided webpack configuration and reproduce the v4-to-v5 upgrade using HtmlWebpackPlugin and MiniCssExtractPlugin. Compare the generated HTML and review the plugin behavior responsible for asset insertion order. Done means explaining the change from v4, or identifying a confirmed regression with a focused reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, webpack
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100