aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-06-27 01:05:57 +0800
committerGitHub <noreply@github.com>2019-06-27 01:05:57 +0800
commit3f8c9126fda5251f6ba8cb2e98875bae4ddb8d6d (patch)
tree08136f7d397cbec4de6b36bb52d0edfe5c6e915c
parent76e7c3bd1f63cd75f111e4505ff6460fbb7525db (diff)
downloadtangerine-wallet-browser-3f8c9126fda5251f6ba8cb2e98875bae4ddb8d6d.tar.gz
tangerine-wallet-browser-3f8c9126fda5251f6ba8cb2e98875bae4ddb8d6d.tar.zst
tangerine-wallet-browser-3f8c9126fda5251f6ba8cb2e98875bae4ddb8d6d.zip
Use inline source maps in development (#6754)
There is currently a bug in chrome that prevents reading source maps from a local file [0]. This was preventing Chrome DevTools from using our JavaScript source maps, where were saved as `.map` files. To work around this problem the source maps are now generated inline, which seems to work fine. The only other browser I tested this with was Firefox, which works both before and after this change. [0]: https://bugs.chromium.org/p/chromium/issues/detail?id=931675
-rw-r--r--gulpfile.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/gulpfile.js b/gulpfile.js
index ea35d5c5a..6ea02c52c 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -347,7 +347,7 @@ function createTasksForBuildJsExtension ({ buildJsFiles, taskPrefix, devMode, te
const destinations = browserPlatforms.map(platform => `./dist/${platform}`)
bundleTaskOpts = Object.assign({
buildSourceMaps: true,
- sourceMapDir: devMode ? './' : '../sourcemaps',
+ sourceMapDir: '../sourcemaps',
minifyBuild: !devMode,
buildWithFullPaths: devMode,
watch: devMode,
@@ -604,10 +604,17 @@ function bundleTask (opts) {
}))
}
- // Finalize Source Maps (writes .map file)
+ // Finalize Source Maps
if (opts.buildSourceMaps) {
- buildStream = buildStream
- .pipe(sourcemaps.write(opts.sourceMapDir))
+ if (opts.devMode) {
+ // Use inline source maps for development due to Chrome DevTools bug
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=931675
+ buildStream = buildStream
+ .pipe(sourcemaps.write())
+ } else {
+ buildStream = buildStream
+ .pipe(sourcemaps.write(opts.sourceMapDir))
+ }
}
// write completed bundles