Fixed sourcemap generation script
This commit is contained in:
parent
141341c28d
commit
0f9362c6ca
@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"start": "node dist/app.js",
|
||||
"build": "webpack --env production",
|
||||
"sourcemap": "webpack --env production sourcemap",
|
||||
"prewatch": "yarn lint-build",
|
||||
"watch": "webpack --watch",
|
||||
"lint": "eslint \"./{src, tests}/**\" --fix",
|
||||
|
@ -5,9 +5,9 @@ const NodemonPlugin = require('nodemon-webpack-plugin')
|
||||
module.exports = env => {
|
||||
const isProduction = !!env.production
|
||||
const generateSourceMap = !!env.sourcemap
|
||||
let devtool = false
|
||||
if (!isProduction) {
|
||||
devtool = generateSourceMap ? 'source-map' : 'eval'
|
||||
let devtool = 'eval'
|
||||
if (isProduction) {
|
||||
devtool = generateSourceMap ? 'source-map' : false
|
||||
}
|
||||
const config = {
|
||||
mode: isProduction ? 'production' : 'development',
|
||||
|
Loading…
Reference in New Issue
Block a user