-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (44 loc) · 1.11 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
const LiveReloadPlugin = require('webpack-livereload-plugin')
const isDev = process.env.NODE_ENV === 'development'
module.exports = {
entry: './client/index.js',
output: {
path: __dirname,
filename: './public/bundle.js'
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.svg$/,
use: [
"babel-loader",
{
loader: "react-svg-loader",
options: {
svgo: {
plugins: [
{ removeTitle: false }
],
floatPrecision: 2
}
}
}
]
},
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader'
},
{
test: /\.css$/,
use:['style-loader','css-loader']
},
]
},
// When we're in development, we can use this handy live-reload plugin
// to refresh the page for us every time we make a change to our client-side
// files. It's like `nodemon` for the front end!
plugins: isDev ? [new LiveReloadPlugin({appendScriptTag: true})] : []
}