You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
835 B

'use strict';
const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: {
content: './src/content',
background: './src/background',
options: './src/options'
},
plugins: [
new webpack.DefinePlugin({
process: '0'
}),
new webpack.optimize.ModuleConcatenationPlugin()
],
output: {
path: path.join(__dirname, 'extension'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader'
}
}
]
}
};
if (process.env.NODE_ENV === 'production') {
module.exports.plugins.push(
new UglifyJSPlugin({
sourceMap: true,
uglifyOptions: {
mangle: false,
output: {
beautify: true
}
}
})
);
}