-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebpack.config.dev.babel.js
More file actions
91 lines (89 loc) · 1.94 KB
/
webpack.config.dev.babel.js
File metadata and controls
91 lines (89 loc) · 1.94 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// import path from 'path'
import webpack from 'webpack'
import paths from './paths'
export default {
/* devtool: 'cheap-module-eval-source-map',
entry: {
'index': [
'webpack-dev-server/client?http://0.0.0.0:3000',
'webpack/hot/only-dev-server',
'react-hot-loader/patch',
path.join(paths.src, 'index.js')
]
},
output: {
path: paths.dist,
filename: '[name].js'
},*/
// target: 'node-webkit',
devServer: {
quiet: true,
contentBase: paths.dist,
hot: true,
port: 3000,
// lazy: true,
noInfo: true,
inline: true,
publicPath: '',
stats: {
cached: true,
colors: true
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('development')
}
}),
new webpack.ProvidePlugin({
'Promise': 'exports?global.Promise!es6-promise',
// import fetch
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
}),
// new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
stats: {
colors: true
},
module: {
loaders: [{
test: /\.html$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\.json$/,
loader: 'json'
}, {
test: /\.css$/,
loader: 'style!css?modules',
include: paths.src_path
}, {
test: /\.css$/,
loader: 'style!css',
include: paths.node_modules
}, {
test: /\.styl$/,
loader: 'style!css?modules!stylus',
include: paths.src_path
}, {
test: /\.jsx?$/,
loader: 'babel',
// only handle js file in src
include: paths.src_path
}, {
test: /\.(jpe?g|png|gif|svg)$/i,
loader: 'url'
}],
noParse: [
// 'react/dist/react.js',
// 'react-dom/dist/react-dom.js'
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.json', '.coffee'],
alias: {
}
}
}