-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
36 lines (35 loc) · 947 Bytes
/
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
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: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader'
},
{
test: /\.scss$/,
use: [
'style-loader',
'css-loader',
'sass-loader'
]
},
{
test: /\.svg$|\.ttf?|\.woff$|\.woff2|\.eof|\.eot/,
loader: 'file-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})] : []
}