Optimizing build time + inline small files into CSS

This commit is contained in:
David Négrier 2021-05-17 15:42:12 +02:00
parent db40681be7
commit 849e68ece2

View file

@ -39,25 +39,27 @@ module.exports = {
}, },
{ {
test: /\.scss$/, test: /\.scss$/,
exclude: /node_modules/,
use: [ use: [
MiniCssExtractPlugin.loader, { MiniCssExtractPlugin.loader, {
loader: 'css-loader', loader: 'css-loader',
/*options: { options: {
url: false, //url: false,
sourceMap: true sourceMap: true
}*/ }
}, 'sass-loader'], }, 'sass-loader'],
}, },
{ {
test: /\.css$/, test: /\.css$/,
exclude: /node_modules/,
use: [ use: [
MiniCssExtractPlugin.loader, MiniCssExtractPlugin.loader,
{ {
loader: 'css-loader', loader: 'css-loader',
/*options: { options: {
url: false, //url: false,
sourceMap: true sourceMap: true
}*/ }
} }
] ]
}, },
@ -95,8 +97,9 @@ module.exports = {
} }
}, },
{ {
test: /\.(ttf|eot|svg|png|gif|jpg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, test: /\.(ttf|eot|svg|png|gif|jpg)$/,
type: 'asset/resource' exclude: /node_modules/,
type: 'asset'
} }
], ],
}, },
@ -164,6 +167,6 @@ module.exports = {
assets: true, assets: true,
entrypoints: false, entrypoints: false,
errorDetails: false, errorDetails: false,
} },
} as Configuration & WebpackDevServer.Configuration; } as Configuration & WebpackDevServer.Configuration;