build(frontend): tweak webpack config
This commit is contained in:
parent
6b5b1f0f41
commit
de357becbd
@ -44,8 +44,7 @@ async function webpackConfig() {
|
|||||||
{
|
{
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
// plugins: ['syntax-dynamic-import'],
|
plugins: ['@babel/plugin-syntax-dynamic-import'],
|
||||||
//
|
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'@babel/preset-env',
|
'@babel/preset-env',
|
||||||
@ -68,31 +67,17 @@ async function webpackConfig() {
|
|||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.css$/i,
|
test: /\.(sa|sc|c)ss$/i,
|
||||||
use: [ MiniCssExtractPlugin.loader,
|
use: [
|
||||||
{ loader: 'css-loader', options: { sourceMap: true }},
|
MiniCssExtractPlugin.loader,
|
||||||
{ loader: 'postcss-loader', options: {
|
{ loader: 'css-loader', options: { sourceMap: true }},
|
||||||
sourceMap: true,
|
{ loader: 'postcss-loader', options: {
|
||||||
postcssOptions: {
|
sourceMap: true,
|
||||||
plugins: [ 'postcss-preset-env' ]
|
postcssOptions: { plugins: [ 'postcss-preset-env', 'autoprefixer' ], },
|
||||||
}
|
}},
|
||||||
}},
|
{ loader: 'resolve-url-loader', options: { sourceMap: true }},
|
||||||
{ loader: 'resolve-url-loader', options: { sourceMap: true }}
|
{ loader: 'sass-loader', options: { implementation: import('sass'), sourceMap: true }},
|
||||||
]
|
],
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.s(c|a)ss$/i,
|
|
||||||
use: [ MiniCssExtractPlugin.loader,
|
|
||||||
{ loader: 'css-loader', options: { sourceMap: true }},
|
|
||||||
{ loader: 'postcss-loader', options: {
|
|
||||||
sourceMap: true,
|
|
||||||
postcssOptions: {
|
|
||||||
plugins: [ 'postcss-preset-env' ]
|
|
||||||
}
|
|
||||||
}},
|
|
||||||
{ loader: 'resolve-url-loader', options: { sourceMap: true }},
|
|
||||||
{ loader: 'sass-loader', options: { implementation: import('sass'), sourceMap: true }}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(woff(2)?|ttf|eot|svg)(\?.*)?$/i,
|
test: /\.(woff(2)?|ttf|eot|svg)(\?.*)?$/i,
|
||||||
@ -208,7 +193,15 @@ async function webpackConfig() {
|
|||||||
sourceMap: true
|
sourceMap: true
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin(),
|
new CssMinimizerPlugin({
|
||||||
|
parallel: true,
|
||||||
|
minimizerOptions: {
|
||||||
|
preset: [
|
||||||
|
'default',
|
||||||
|
{ discardComments: { removeAll: true, } },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
moduleIds: 'named',
|
moduleIds: 'named',
|
||||||
chunkIds: 'named',
|
chunkIds: 'named',
|
||||||
|
|||||||
Reference in New Issue
Block a user