-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
41 lines (33 loc) · 917 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
var webpack = require("webpack");
var ChunkManifestPlugin = require('chunk-manifest-webpack-plugin');
var TESTING = JSON.parse(process.env.TESTING || "false");
var srcDirectory = TESTING ? "./src/current-testcase" : "./src/testcase-1";
var distDirectory = TESTING ? "./dist/current-dist" : "./dist";
var config = {
entry: {
"entry-1": [srcDirectory + "/entry-1"],
"entry-2": [srcDirectory + "/entry-2"],
"vendor": [srcDirectory + "/vendor"]
},
output: {
path: distDirectory,
publicPath: "/",
filename: "[name].[chunkhash].js",
chunkFilename: "[name].[chunkhash].js"
},
resolve: {
extensions: ["", ".js"]
},
plugins: [
new ChunkManifestPlugin({
filename: "webpack-manifest.json",
manifestVariable: "webpackManifest"
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendor"
}),
new webpack.optimize.OccurenceOrderPlugin()
],
bail: true
};
module.exports = config;