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": { "scripts": {
"start": "node dist/app.js", "start": "node dist/app.js",
"build": "webpack --env production", "build": "webpack --env production",
"sourcemap": "webpack --env production sourcemap",
"prewatch": "yarn lint-build", "prewatch": "yarn lint-build",
"watch": "webpack --watch", "watch": "webpack --watch",
"lint": "eslint \"./{src, tests}/**\" --fix", "lint": "eslint \"./{src, tests}/**\" --fix",

View File

@ -5,9 +5,9 @@ const NodemonPlugin = require('nodemon-webpack-plugin')
module.exports = env => { module.exports = env => {
const isProduction = !!env.production const isProduction = !!env.production
const generateSourceMap = !!env.sourcemap const generateSourceMap = !!env.sourcemap
let devtool = false let devtool = 'eval'
if (!isProduction) { if (isProduction) {
devtool = generateSourceMap ? 'source-map' : 'eval' devtool = generateSourceMap ? 'source-map' : false
} }
const config = { const config = {
mode: isProduction ? 'production' : 'development', mode: isProduction ? 'production' : 'development',