-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
40 lines (39 loc) · 958 Bytes
/
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
36
37
38
39
40
let path = require('path');
let webpack = require('webpack');
let pluginClean = require('clean-webpack-plugin');
let pluginCopy = require('copy-webpack-plugin');
module.exports = {
entry: {
"chrome-content-script": "./src/chrome-content-script.js",
"chrome-background-script": "./src/chrome-background-script.js"
},
output: {
path: path.join(__dirname, 'build'),
filename: "[name].bundle.js"
},
module: {
preLoaders: [
{test: /\.js$/, loader: "eslint-loader", exclude: /node_modules/}
],
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}
]
},
plugins: [
new pluginClean(['dist', 'build'], {
root: __dirname,
verbose: true,
dry: false
}),
new pluginCopy([
{ from: path.join(__dirname, 'resources'), to: path.join(__dirname, 'build') }
])
]
};