Skip to content

Commit

Permalink
Always generate full source map. (mattermost#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller committed Dec 3, 2018
1 parent 5880b32 commit cb9dec0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ run: node_modules ## Runs app

npm run run &

run-fullmap: node_modules ## Runs the app with the JS mapped to source (good for debugger)
@echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP
run-fullmap: node_modules ## Legacy alias to run
@echo Running mattermost Webapp for development

npm run run-fullmap &
npm run run &

stop: ## Stops webpack
@echo Stopping changes watching
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@
"check": "eslint --ignore-pattern node_modules --ignore-pattern non_npm_dependencies --ignore-pattern dist --ext .js --ext .jsx . --quiet",
"fix": "eslint --ignore-pattern node_modules --ignore-pattern non_npm_dependencies --ignore-pattern dist --ext .js --ext .jsx . --quiet --fix",
"build": "cross-env NODE_ENV=production webpack --display-error-details --verbose",
"run": "cross-env NODE_ENV=production webpack --progress --watch",
"run-fullmap": "webpack --progress --watch",
"run": "webpack --progress --watch",
"test": "jest --forceExit --detectOpenHandles",
"stats": "cross-env NODE_ENV=production webpack --profile --json > webpack_stats.json",
"updatesnapshot": "jest --updateSnapshot",
Expand Down
13 changes: 2 additions & 11 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ const WebpackPwaManifest = require('webpack-pwa-manifest');
const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env

var DEV = false;
var FULLMAP = false;
var TEST = false;
if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') {
if (NPM_TARGET === 'run') {
DEV = true;
if (NPM_TARGET === 'run-fullmap') {
FULLMAP = true;
}
}

if (NPM_TARGET === 'test') {
Expand All @@ -32,7 +28,6 @@ if (NPM_TARGET === 'test') {
if (NPM_TARGET === 'stats') {
DEV = true;
TEST = false;
FULLMAP = true;
}

const STANDARD_EXCLUDE = [
Expand Down Expand Up @@ -348,11 +343,7 @@ if (NPM_TARGET !== 'stats') {
// Development mode configuration
if (DEV) {
config.mode = 'development';
if (FULLMAP) {
config.devtool = 'source-map';
} else {
config.devtool = 'cheap-module-eval-source-map';
}
config.devtool = 'source-map';
}

// Production mode configuration
Expand Down

0 comments on commit cb9dec0

Please sign in to comment.