-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
58 lines (57 loc) · 1.11 KB
/
webpack.config.js
File metadata and controls
58 lines (57 loc) · 1.11 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
50
51
52
53
54
55
56
57
58
var ExtractTextPlugin = require('extract-text-webpack-plugin'),
path = require('path'),
webpack = require('webpack');
module.exports = {
devServer: {
colors: true,
contentBase: './build',
hot: true,
progress: true
},
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://0.0.0.0:8080',
'webpack/hot/only-dev-server',
'./src/client/main.js'
],
module: {
loaders: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src', 'client')
],
loaders: ['react-hot', 'babel?optional[]=runtime&stage=2']
},
{
test: /\.json?$/,
include: [
path.resolve(__dirname, 'src', 'client')
],
loader: 'json'
},
{
test: /\.css$/,
include: [
path.resolve(__dirname, 'src', 'client')
],
loader: ExtractTextPlugin.extract('css?sourceMap!cssnext')
}
]
},
externals: {
'socket.io-client': 'io'
},
cssnext: {
browsers: 'last 2 versions'
},
plugins: [
new ExtractTextPlugin('bundle.css'),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
output: {
path: './build',
filename: 'bundle.js'
}
};