Closed
Description
- Operating System: linux mint 20
- Node Version: v14.16.0
- NPM Version: 6.14.11
- webpack Version: 5.28.0
- css-loader Version: 3.0.0
Expected Behavior
I expect that the style-loader will add the insert function to the bundle exactly 1 time.
Actual Behavior
But in reality, this function is created for each css file and inserted as an expression, webpack cannot optimize it, because it thinks that these are different functions
Code
//css part of module.rules productuion config
{
test: /\.css$/,
exclude: /\.page\.css$/,
use: [
{
loader: 'style-loader',
options: {
injectType: 'singletonStyleTag',
insert: [Function: _insertCssIntoIframeImportedByStyleLoader]
}
},
'css-modules-typescript-loader'
]
},
{
test: /\.page\.css$/,
use: [ 'style-loader', 'css-modules-typescript-loader' ]
},
{
test: /\.css$/,
use: [
{
loader: 'css-loader',
options: {
importLoaders: 1,
modules: { localIdentName: '[hash:base64:5]' }
}
},
'postcss-loader'
]
}
Metadata
Metadata
Assignees
Labels
No labels