Fixed sourcemap generation script

This commit is contained in:
RemixDev 2022-03-09 11:21:46 +01:00
parent 141341c28d
commit 0f9362c6ca
2 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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',