-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.babel.js
83 lines (82 loc) · 1.7 KB
/
webpack.dev.babel.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
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
import _ from 'lodash';
import paths from './paths';
import webpack from 'webpack';
import pkg from './package.json';
/**
* This config builds in memory and serves the app.
* @type {{}}
*/
export default {
entry: {
app: [
'webpack/hot/only-dev-server',
paths.entry,
],
vendors: [
'lodash',
'jquery',
'classnames',
'Chart.js',
'anny',
'radium',
'history/lib/createBrowserHistory',
'react',
'react-ace',
'react-dom',
'react-router',
'brace/mode/javascript',
'brace/theme/tomorrow',
'stardust',
],
},
output: {
path: paths.build,
filename: '[name].js'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['react-hot', 'babel', 'eslint'],
include: paths.src,
},
{
test: /stardust/,
loaders: ['babel'],
include: paths.node_modules,
},
],
},
externals: {
'anny': 'anny',
'jquery': 'jQuery',
'lodash': '_',
'Chart.js': 'Chart'
},
devTool: 'source-map',
resolve: {
root: paths.root,
modulesDirectories: [
'node_modules',
'.',
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
],
// Webpack Dev Server
// http://webpack.github.io/docs/webpack-dev-server.html#api
devServer: {
contentBase: paths.root,
hot: true,
historyApiFallback: true,
quiet: false, // log nothing
noInfo: false, // log only warnings and errors
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
stats: require('./webpack-stats'),
}
};