config: Enable source maps in development for front-end debugging (#84)

* config: Enable source maps in development for front-end debugging

* feat: Switch to source map for dev env as used by create react app
This commit is contained in:
Luke Schoen 2018-06-13 09:18:35 +02:00 committed by Jaco Greeff
parent 61e7d21b84
commit d7319e809b
4 changed files with 16 additions and 5 deletions

View File

@ -23,9 +23,9 @@ function createWebpack ({ alias = {}, context, name = 'index' }) {
return {
context,
devtool: isProd ? 'source-map' : false,
devtool: isProd ? 'source-map' : 'cheap-eval-source-map',
entry: `./src/${name}.js`,
mode: isProd ? 'production' : 'development',
mode: ENV,
output: {
path: path.join(context, 'build'),
filename: `[name].[hash:8].js`,

View File

@ -3,10 +3,14 @@
// 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: 'development',
mode: ENV,
output: {
path: __dirname,
filename: './demo.js'

View File

@ -3,10 +3,14 @@
// 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: 'development',
mode: ENV,
output: {
path: __dirname,
filename: './demo.js'

View File

@ -4,11 +4,14 @@
// @flow
const path = require('path');
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: 'development',
mode: ENV,
output: {
path: __dirname,
filename: './demo.js'