forked from trotto/browser-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
28 lines (25 loc) · 753 Bytes
/
webpack.config.js
File metadata and controls
28 lines (25 loc) · 753 Bytes
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
const path = require('path');
const webpack = require('webpack');
module.exports = (env, { edition, distDir, browser, instanceUrl }) => {
if (!(edition && browser && instanceUrl)) {
throw new Error('edition, browser, and instanceUrl arguments are required');
return { bail: true };
}
return {
entry: {
background: `./src/background/entryPoints/${browser}.js`,
popup: `./src/popup/entryPoints/${browser}.js`,
data_injector: './src/data_injector.js',
options: './src/options.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, distDir)
},
plugins: [
new webpack.DefinePlugin({
__DEFAULT_INSTANCE__: JSON.stringify(instanceUrl)
})
]
};
};