-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
35 lines (34 loc) · 1.29 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const CopyPlugin = require("copy-webpack-plugin");
const path = require('path');
module.exports = (env, argv) => {
return {
entry: {
},
output: {
// filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist-firefox')
},
devtool: argv.mode === 'production' ? "source-map" : "inline-cheap-source-map",
optimization: {
// This ensures each entry point gets its own file
splitChunks: {
chunks: 'async'
},
minimize: false
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js', to: 'browser-polyfill.js' },
{ from: 'src/background.js', to: 'background.js' },
{ from: 'src/content.js', to: 'content.js' },
{ from: 'src/options.html', to: 'options.html' },
{ from: 'src/options.js', to: 'options.js' },
{ from: 'src/options_const.js', to: 'options_const.js' },
{ from: 'manifest-firefox.json', to: 'manifest.json' },
{ from: 'icons/*.png', to: '[name][ext]' }
]
})
]
};
};