nightTab/webpack.prod.js

35 lines
921 B
JavaScript

const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require('path');
const ZipPlugin = require('zip-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const version = require('./src/manifest.json').version;
const name = require('./src/manifest.json').name;
module.exports = merge(common, {
mode: 'production',
optimization: {
minimize: true,
minimizer: [
new CssMinimizerPlugin({
minify: CssMinimizerPlugin.cleanCssMinify
})
]
},
module: {
rules: [{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
}],
},
plugins: [
new MiniCssExtractPlugin(),
new ZipPlugin({
path: path.resolve(__dirname, 'dist/extension'),
filename: name + '_' + version + '.zip'
})
]
});