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