mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-04-11 17:29:04 +02:00
35 lines
973 B
JavaScript
35 lines
973 B
JavaScript
const path = require('path');
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
const TerserJSPlugin = require('terser-webpack-plugin');
|
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: {
|
|
bundle: './src/js/index.js',
|
|
sw: './src/js/Worker.js'
|
|
},
|
|
output: {
|
|
filename: '[name].js',
|
|
path: path.resolve(__dirname, 'dist')
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.scss$/,
|
|
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"]
|
|
}
|
|
]
|
|
},
|
|
mode: 'production',
|
|
optimization: {
|
|
usedExports: true,
|
|
minimizer: [new TerserJSPlugin(), new OptimizeCSSAssetsPlugin()]
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: '[name].css',
|
|
chunkFilename: '[id].css',
|
|
path: path.resolve(__dirname, 'dist')
|
|
})
|
|
]
|
|
}; |