Fixed sourcemap generation script
This commit is contained in:
parent
141341c28d
commit
0f9362c6ca
@ -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",
|
||||||
|
@ -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',
|
||||||
|
Loading…
Reference in New Issue
Block a user