1
0
Fork 0
mirror of https://github.com/mCaptcha/mCaptcha.git synced 2025-03-26 11:19:00 +03:00
mCaptcha/frontend/webpack.prod.js

69 lines
1.8 KiB
JavaScript
Raw Normal View History

const path = require('path');
const common = require('./webpack.common');
const merge = require('webpack-merge');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = merge(common, {
mode: 'production',
output: {
2021-04-09 14:21:43 +05:30
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
},
optimization: {
minimizer: [
new OptimizeCssAssetsPlugin(),
new TerserPlugin(),
2021-04-09 13:21:50 +05:30
],
},
plugins: [
2021-04-09 14:21:43 +05:30
new MiniCssExtractPlugin({filename: '[name].css'}),
2021-04-09 13:21:50 +05:30
new CleanWebpackPlugin(),
],
module: {
rules: [
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader, //3. Extract css into files
'css-loader', //2. Turns css into commonjs
'sass-loader', //1. Turns sass into css
],
},
],
},
});
/*
* new HtmlWebpackPlugin({
2021-04-03 17:18:18 +05:30
template: path.resolve(__dirname, 'output', 'index.html'),
minify: {
removeAttributeQuotes: true,
collapseWhitespace: true,
removeComments: true,
},
}),
new HtmlWebpackPlugin({
2021-04-05 17:26:58 +05:30
filename: 'register/index.html', // output filename
template: path.resolve(__dirname, 'output/register/', 'index.html'),
minify: {
removeAttributeQuotes: true,
collapseWhitespace: true,
removeComments: true,
},
}),
2021-04-05 16:38:32 +05:30
new HtmlWebpackPlugin({
filename: 'panel/index.html',
template: './output/panel/index.html',
2021-04-06 21:34:11 +05:30
minify: {
removeAttributeQuotes: true,
collapseWhitespace: true,
removeComments: true,
}
2021-04-05 16:38:32 +05:30
}),
2021-04-09 13:21:50 +05:30
*/