-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
51 lines (47 loc) · 1.13 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
46
47
48
49
50
51
var webpack = require('webpack');
var CommonsChunkPlugin = require("webpack/lib/optimize/CommonsChunkPlugin");
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require('path');
module.exports = {
entry: [
'webpack/hot/dev-server',
'webpack-dev-server/client?http://127.0.0.1:8080',
'./app/js/app.jsx'
],
output: {
filename: 'bundle.js',
path: "./build"
},
resolve: {
extensions: ['', '.js', '.jsx'],
},
module: {
loaders: [{
test: /\.jsx$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react']
}
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
}, {
test: /\.less$/,
loader: "style!css!less"
}]
},
plugins: [
new CommonsChunkPlugin('init.js'),
new webpack.HotModuleReplacementPlugin(),
// new webpack.DefinePlugin({
// __DEBUG__: true
// })
// new OpenBrowserPlugin({ url: 'http://127.0.0.1:8080' })
]
};