-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.dev.js
71 lines (69 loc) · 1.82 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var FaviconsWebpackPlugin = require('favicons-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
// or devtool: 'eval' to debug issues with compiled output:
devtool: 'eval',
entry: [
// necessary for hot reloading with IE:
'eventsource-polyfill',
// listen to code updates emitted by hot middleware:
'webpack-hot-middleware/client',
// your code:
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
resolve: {
modulesDirectories: ['./src', './node_modules']
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new FaviconsWebpackPlugin({
logo: './assets/favicon.png',
prefix: 'icons-[hash]/'
}),
new HtmlWebpackPlugin({
template: 'index.html'
}),
new CopyWebpackPlugin([{
from: './assets/backgrounds/',
to: './assets/backgrounds/'
}])
],
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.css$/,
loaders: [
'style-loader',
'css-loader'
]
},
{
test: /\.(ttf|jpg|png|otf|eot|woff|woff2)/,
loader: 'url?limit=100000'
},
{
test: /\.svg(\?.*)?$/,
loader: 'babel!svg-react' +
// removes xmlns tag from svg (see https://github.com/jhamlet/svg-react-loader/issues/25)
'!string-replace?search=%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22&replace=' +
'!string-replace?search=%20data-name%3D%22%5B%5Cw%5Cs_-%5D*%22&replace=&flags=ig'
}]
}
};