vjfw/webpack.config.js

33 lines
738 B
JavaScript
Raw Normal View History

2024-05-25 14:07:17 +00:00
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2024-05-27 06:46:25 +00:00
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin");
2024-05-25 14:07:17 +00:00
module.exports = {
entry: './src/js/app.js',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
],
},
2024-05-27 06:46:25 +00:00
optimization: {
minimizer: [
new CssMinimizerPlugin(),
],
},
2024-05-25 14:07:17 +00:00
plugins: [
new MiniCssExtractPlugin({
filename: 'styles.css',
}),
],
mode: 'development', // or 'production'
};