mirror of
https://github.com/zombieFox/nightTab.git
synced 2025-08-17 09:11:28 +02:00
production webpack file
This commit is contained in:
34
webpack.prod.js
Normal file
34
webpack.prod.js
Normal file
@ -0,0 +1,34 @@
|
||||
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'
|
||||
})
|
||||
]
|
||||
});
|
Reference in New Issue
Block a user