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:
parent
61e7d21b84
commit
d7319e809b
@ -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`,
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user