mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-30 20:14:19 +01:00
46 lines
1.2 KiB
JavaScript
46 lines
1.2 KiB
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 TerserPlugin = require('terser-webpack-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
|
|
}),
|
|
new TerserPlugin({
|
|
terserOptions: {
|
|
format: {
|
|
comments: false,
|
|
},
|
|
},
|
|
extractComments: false,
|
|
})
|
|
]
|
|
},
|
|
module: {
|
|
rules: [{
|
|
test: /\.css$/i,
|
|
use: [MiniCssExtractPlugin.loader, 'css-loader'],
|
|
}],
|
|
},
|
|
plugins: [
|
|
new MiniCssExtractPlugin({
|
|
filename: '[name].[contenthash].css'
|
|
}),
|
|
new ZipPlugin({
|
|
path: path.resolve(__dirname, 'dist/extension'),
|
|
filename: name + '_' + version + '.zip'
|
|
})
|
|
]
|
|
});
|