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
This commit is contained in:
Daniel Büchele
2018-09-25 03:44:52 -07:00
committed by Facebook Github Bot
parent 777e9323de
commit 36d00bce4c
2 changed files with 6 additions and 0 deletions

View File

@@ -156,6 +156,9 @@ function compile(buildFolder) {
minify: false, minify: false,
resetCache: true, resetCache: true,
sourceMap: 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'), entry: path.join(__dirname, '..', 'src', 'init.js'),
out: path.join(buildFolder, 'bundle.js'), out: path.join(buildFolder, 'bundle.js'),
}, },

View File

@@ -173,6 +173,9 @@ async function compilePlugin(
out, out,
dev: false, dev: false,
sourceMap: 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',
}, },
); );
} catch (e) { } catch (e) {