/
webpack.config.hot.js
53 lines (50 loc) · 1.26 KB
/
webpack.config.hot.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
'use strict';
var path = require('path');
var webpack = require('webpack');
var NpmInstallPlugin = require('npm-install-webpack-plugin');
var config = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://0.0.0.0:3000',
'webpack/hot/only-dev-server',
'./src/js/index.js'
],
output: {
path: path.join(__dirname, 'build'),
publicPath: '/build/',
filename: 'bundle.js'
},
module: {
preLoaders: [
{
test: /\.jsx?$/,
loaders: ['eslint'],
include: path.join(__dirname, 'src/js')
}
],
loaders: [
{ test: /\.(jpe?g|png|gif|svg)$/,
loader: 'url?limit=25000'
},
{ test: /\.(js|jsx)$/,
exclude: /node_modules/,
loaders: ['react-hot','babel?stage=0&optional=runtime&plugins=typecheck'],
include: path.join(__dirname, 'src/js')
},
{ test: /\.scss$/,
loader: 'style!css!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap=true&sourceMapContents=true'
}
],
noParse: []
},
resolve: {
extensions: ['', '.js', '.jsx', '.json'],
alias: {}
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new NpmInstallPlugin()
]
};
module.exports = config;