-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
39 lines (37 loc) · 913 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
var path = require('path');
var webpack = require('webpack');
// var CommonsChunkPlugin = require("./node_modules/webpack/lib/optimize/CommonsChunkPlugin");
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('commons.js');
module.exports = {
context: __dirname + "/static/js",
entry: {
test1: "./test1",
test2: "./test2"
},
resolve: {
extensions: ['', '.js', '.jsx']
},
output: {
publicPath: "./build_js/",
path: path.join(__dirname, "/static/build_js"),
filename: "[name].bundle.js",
chunkFilename: "[id].chunk.js"
},
plugins: [
commonsPlugin,
],
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: "babel-loader",
},
{
test: /\.html$/,
loader: "file?name=[name].[ext]",
},
],
},
}