Answer the question
In order to leave comments, you need to log in
Grouping (optimization) CSS classes and styles as output from WebPack 4?
Greetings!
I am compiling the project through webpack 4 and I get "semi-optimized" css as a result.
{
test: /\.((s[ac]|c)ss)$/,
use: [
PLUGINS.mini_css_extract_plugin.loader,
{
loader: 'css-loader',
options: {
sourceMap: !isProduction
}
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
sourceMap: !isProduction,
plugins: (() => {
return isProduction ? [
require('autoprefixer')({
browsers: ['last 2 versions']
}),
require('cssnano')({
preset: 'default'
}),
require("css-mqpacker")
] : []
})()
}
},
{
loader: 'sass-loader',
options: {
outputStyle: 'expanded',
sourceMap: !isProduction
}
},
]
},
.class_1 {
width: 1px;
}
.class_2 {
width: 1px;
}
.class_3 {
width: 2px;
}
.class_1, .class_2 {
width: 1px
}
.class_3 {
width: 2px
}
.class_1 {
width: 1px;
}
.class_3 {
width: 2px;
}
.class_2 {
width: 1px;
}
.class_1 {
width: 1px
}
.class_3 {
width: 2px
}
.class_2 {
width: 1px
}
.class_1 {
width: 1px;
}
.class_3 {
color: red;
}
.class_2 {
width: 1px;
}
.class_1 {
width: 1px
}
.class_3 {
color: red
}
.class_2 {
width: 1px
}
Answer the question
In order to leave comments, you need to log in
I would like to optimize all classesthis is not called optimization, but “I don’t understand what’s going on”
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question