-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
49 lines (48 loc) · 1.37 KB
/
Copy pathwebpack.config.js
File metadata and controls
49 lines (48 loc) · 1.37 KB
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
42
43
44
45
46
47
48
49
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
module.exports = [
{
entry: {
background: "./javascripts/background.js",
popup: "./javascripts/popup.js",
},
output: {
path: path.resolve(__dirname, "./dist/assets/javascripts"),
filename: "[name].js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: "babel-loader",
exclude: /node_modules/,
query: {
cacheDirectory: true,
presets: ["react", "es2015"]
}
},
{
test: /\.css$/,
loaders: ["style-loader", "css-loader?modules"]
}
]
},
plugins: [
new ExtractTextPlugin("[name].css"),
new CopyWebpackPlugin([
{ from: "html", to: "../html" },
{ from: "javascripts/popper.min.js", to: "../javascripts/popper.min.js" },
{ from: "javascripts/tooltip.min.js", to: "../javascripts/tooltip.min.js" },
{ from: "stylesheets", to: "../stylesheets", ignore: [ '*.scss' ] },
{ from: "image", to: "../image" },
{ from: "fonts", to: "../fonts" },
{ from: "manifest.json", to: "../manifest.json" },
])
],
devtool: "source-map",
resolve: {
extensions: [".js", ".jsx", ".scss"]
}
}
];