forked from mozilla/activity-stream
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
45 lines (41 loc) · 1.21 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
36
37
38
39
40
41
42
43
44
45
"use strict";
const webpack = require("webpack");
const webpack_common = require("./webpack.common");
const path = require("path");
const absolute = relPath => path.join(__dirname, relPath);
const srcPath = absolute("./content-src/main.js");
const outputDir = absolute("./data/content");
const outputFilename = "bundle.js";
let env = process.env.NODE_ENV || "development";
if (env !== "test") {
webpack_common.plugins.push(
new webpack.optimize.CommonsChunkPlugin({name: "vendor", filename: "vendor.bundle.js"}));
}
module.exports = {
entry: {
app: srcPath,
vendor: [
"react",
"react-dom",
"react-redux",
"redux"
]
},
output: {
path: outputDir,
filename: outputFilename
},
node: {Buffer: true, url: false},
target: "web",
module: webpack_common.module,
devtool: env === "production" ? false : "eval", // This is for Firefox
plugins: webpack_common.plugins,
resolve: {
extensions: webpack_common.resolve.extensions,
alias: Object.assign({}, webpack_common.resolve.alias, {
// this is so we can use external dependencies in common files
// without importing the pre-built version
"common/vendor": absolute("./common/vendor-src")
})
}
};