-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.dev.js
47 lines (46 loc) · 1.13 KB
/
webpack.config.dev.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
const webpack = require('webpack');
const path = require('path');
const assetsPath = path.resolve(__dirname, 'public');
module.exports = {
devtool: 'source-map',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/dev-server',
path.join(__dirname, 'src', 'index.js')
],
output: {
path: assetsPath,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [
// ES6 Loader
{
test: path.join(__dirname, 'src'),
loader: ['babel-loader'],
query: {
presets: ['react', 'es2015']
}
},
// SCSS Loader
{
test: /\.sass$/,
loaders: ['style-loader', 'css-loader', 'sass-loader']
},
// URL Loader
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif)(\?\S*)?$/,
loader: 'url-loader?limit=100000',
},
]
},
plugins: [
// Webpack 1.0
//new webpack.optimize.OccurenceOrderPlugin(),
// Webpack 2.0 fixed this mispelling
// new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
]
};