/
webpack.dev.config.js
68 lines (67 loc) · 1.45 KB
/
webpack.dev.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
62
63
64
65
66
67
68
const path = require('path');
const webpack = require('webpack');
module.exports = {
mode: 'development',
entry: './example/bootstrap.jsx',
output: {
path: __dirname + '/example/',
publicPath: '/',
filename: 'bundle.js'
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx'],
alias: {
react: path.resolve(__dirname, './node_modules/react')
}
},
module: {
rules: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: [
/node_modules/,
/\*.spec.jsx?/
]
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
use: [
'url-loader?limit=10000',
{
loader: 'img-loader',
options: {
enabled: true,
gifsicle: {
interlaced: false
},
mozjpeg: {
progressive: true,
arithmetic: false
},
optipng: false,
pngquant: {
floyd: 0.5,
speed: 2
},
svgo: {
plugins: [
{ removeTitle: true },
{ convertPathData: false }
]
}
}
}
]
},
{
test: /\.(eot|ttf|woff|woff2)$/,
loader: 'file-loader?name=fonts/[name].[ext]'
}
]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin()
]
};