-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
35 lines (32 loc) · 984 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
'use strict';
const LiveReloadPlugin = require('webpack-livereload-plugin'),
devMode = require('.').isDevelopment,
/**
* Fast source maps rebuild quickly during development, but only give a link
* to the line where the error occurred. The stack trace will show the bundled
* code, not the original code. Keep this on `false` for slower builds but
* usable stack traces. Set to `true` if you want to speed up development.
*/
USE_FAST_SOURCE_MAPS = false;
module.exports = {
entry: './app/main.jsx',
output: {
path: __dirname,
filename: './public/bundle.js'
},
context: __dirname,
devtool: devMode && USE_FAST_SOURCE_MAPS ? 'cheap-module-eval-source-map' : 'source-map',
resolve: {
extensions: ['.js', '.jsx', '.json', '*']
},
module: {
rules: [
{
test: /jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader' // config in .babelrc
}
]
},
plugins: devMode ? [new LiveReloadPlugin({ appendScriptTag: true })] : []
};