-
Notifications
You must be signed in to change notification settings - Fork 6
/
webpack.config.js
41 lines (38 loc) · 1017 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
41
const path = require('path');
const CopyPlugin = require("copy-webpack-plugin");
const dists = ['dist-chrome', 'dist-firefox'];
module.exports = {
entry: {
'dist-chrome/bundle': './src/index.jsx',
'dist-firefox/bundle': './src/index.jsx'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, './'),
},
plugins: [
new CopyPlugin({
patterns: [
{from: "src/*.html", to: "dist-chrome/[name].html"},
{from: "src/*.html", to: "dist-firefox/[name].html"},
{from: "src/*.png", to: "dist-chrome/[name].png"},
{from: "src/*.png", to: "dist-firefox/[name].png"},
{ from: "src/background.js", to: "dist-chrome/" },
{ from: "src/background.js", to: "dist-firefox/" },
{ from: "src/manifest-chrome.json", to: 'dist-chrome/manifest.json'},
{ from: "src/manifest-firefox.json", to: 'dist-firefox/manifest.json'},
],
}),
],
module: {
rules: [
{
test: /\.jsx$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
}
]
}
};