From 36d00bce4cc20e7cb7142fb0ef9747b1848384bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Tue, 25 Sep 2018 03:44:52 -0700 Subject: [PATCH] add source map support Summary: Use inline source maps for plugins and main bundle, both in production and development. Reviewed By: passy Differential Revision: D9967235 fbshipit-source-id: 245e65c6fea94b93dc34a65ae572b7fc98ad56e1 --- scripts/build-release.js | 3 +++ static/compilePlugins.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/build-release.js b/scripts/build-release.js index 5810b83ee..5ba88b01c 100755 --- a/scripts/build-release.js +++ b/scripts/build-release.js @@ -156,6 +156,9 @@ function compile(buildFolder) { minify: false, resetCache: true, sourceMap: true, + // due to a bug in metro inline source maps are only created when + // sourceMapUrl is truthy: https://github.com/facebook/metro/pull/260 + sourceMapUrl: 'inline', entry: path.join(__dirname, '..', 'src', 'init.js'), out: path.join(buildFolder, 'bundle.js'), }, diff --git a/static/compilePlugins.js b/static/compilePlugins.js index a30714770..80a01e89d 100644 --- a/static/compilePlugins.js +++ b/static/compilePlugins.js @@ -173,6 +173,9 @@ async function compilePlugin( out, dev: false, sourceMap: true, + // due to a bug in metro inline source maps are only created when + // sourceMapUrl is truthy: https://github.com/facebook/metro/pull/260 + sourceMapUrl: 'inline', }, ); } catch (e) {