-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
61 lines (55 loc) · 1.63 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
52
53
54
55
56
57
58
59
60
61
'use strict';
var path = require('path');
var webpack = require('webpack');
var buildPath = path.join(__dirname, 'public', 'assets');
var entry = path.join(__dirname, 'app', 'App.js');
module.exports = {
devtool: 'eval',
entry: [
// sets up an ES6-ish environment with promise support
'babel-polyfill',
// The script refreshing the browser on none hot updates
'webpack-dev-server/client?http://localhost:3000',
// For hot style updates
'webpack/hot/only-dev-server',
// the main application script
entry
],
output: {
path: buildPath,
filename: 'bundle.js',
publicPath: '/assets/' // need for hot reload. or hit refresh each time
},
devServer: {
inline: true,
progress: true,
// Only appears to work when running server from CLI and not server.js
contentBase: 'public/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{
test: /\.jsx?$/,
include: [path.join(__dirname, 'app')],
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
cacheDirectory: true,
presets: ['es2015', 'react', 'stage-0']
}
},
{
test: /\.scss$/,
include: path.join(__dirname, 'app', 'scss'),
loader: 'style!css!sass'
}
]
}
};