Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (37 sloc) 1.04 KB
const path = require('path');
const webpack = require('webpack');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const cssnano = require('cssnano');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const plugins = [
new webpack.DefinePlugin({
'process.env.IS_PROD': true,
}),
new CopyWebpackPlugin([
{
from: 'node_modules/webextension-polyfill/dist/browser-polyfill.min.js',
to: 'lib/browser-polyfill.js',
context: '../',
flatten: true,
transform: function(content, path) {
return content.toString().replace('//# sourceMappingURL=browser-polyfill.min.js.map', '')
},
},
]),
new OptimizeCssAssetsPlugin({
assetNameRegExp: /\.css$/g,
cssProcessor: cssnano,
cssProcessorOptions: { discardComments: { removeAll: true } },
canPrint: true,
}),
];
module.exports = {
output: {
path: path.resolve(__dirname, './release/build'),
},
target: 'web',
mode: 'production',
plugins,
// Prefer size and performance
devtool: 'none',
};
You can’t perform that action at this time.