mirror of
https://github.com/fergalmoran/podnoms-web-extension.git
synced 2025-12-22 09:18:11 +00:00
45 lines
880 B
JavaScript
45 lines
880 B
JavaScript
const path = require('path');
|
|
const SizePlugin = require('size-plugin');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
module.exports = {
|
|
devtool: 'sourcemap',
|
|
stats: 'errors-only',
|
|
entry: {
|
|
background: './source/background',
|
|
options: './source/options'
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, 'distribution'),
|
|
filename: '[name].js'
|
|
},
|
|
plugins: [
|
|
new SizePlugin(),
|
|
new CopyWebpackPlugin([
|
|
{
|
|
from: '**/*',
|
|
context: 'source',
|
|
ignore: '*.js'
|
|
},
|
|
{
|
|
from: 'node_modules/webextension-polyfill/dist/browser-polyfill.min.js'
|
|
}
|
|
])
|
|
],
|
|
optimization: {
|
|
minimizer: [
|
|
new TerserPlugin({
|
|
terserOptions: {
|
|
mangle: false,
|
|
compress: false,
|
|
output: {
|
|
beautify: true,
|
|
indent_level: 2 // eslint-disable-line camelcase
|
|
}
|
|
}
|
|
})
|
|
]
|
|
}
|
|
};
|