* config: Enable source maps in development for front-end debugging * feat: Switch to source map for dev env as used by create react app
34 lines
677 B
JavaScript
34 lines
677 B
JavaScript
// Copyright 2017-2018 Jaco Greeff
|
|
// This software may be modified and distributed under the terms
|
|
// of the ISC license. See the LICENSE file for details.
|
|
// @flow
|
|
|
|
const ENV = process.env.NODE_ENV || 'development';
|
|
const isProd = ENV === 'production';
|
|
|
|
module.exports = {
|
|
context: __dirname,
|
|
devtool: isProd ? 'source-map' : 'cheap-eval-source-map',
|
|
entry: './src/demo.js',
|
|
mode: ENV,
|
|
output: {
|
|
path: __dirname,
|
|
filename: './demo.js'
|
|
},
|
|
resolve: {
|
|
alias: {}
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /(node_modules)/,
|
|
use: {
|
|
loader: 'babel-loader'
|
|
}
|
|
}
|
|
]
|
|
},
|
|
plugins: []
|
|
};
|