-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
33 lines (31 loc) · 944 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
const LiveReloadPlugin = require('webpack-livereload-plugin')
const isDev = process.env.NODE_ENV === 'development'
module.exports = {
entry: ['babel-polyfill','./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'
},
// use the style-loader/css-loader combos for anything matching the .css extension
{
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({port: 35727,appendScriptTag: true})] : []
}