From 20ed5b8d3ad198cfbb88c2cb35f70d30a942906e Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Wed, 14 Jun 2017 09:25:53 -0700 Subject: [PATCH] Remove `retainLines` and `sourceMaps` options Summary: `retainLines` is no longer necessary with the much improved source map generation. `sourceMaps` is handled by the transformer itself. Reviewed By: cpojer Differential Revision: D5237103 fbshipit-source-id: e5c6bf5aa9d553fce9c3f4d59b3ea0057d45cfdc --- packages/metro-bundler/src/transformer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/metro-bundler/src/transformer.js b/packages/metro-bundler/src/transformer.js index d70b41aa..54ed8bd5 100644 --- a/packages/metro-bundler/src/transformer.js +++ b/packages/metro-bundler/src/transformer.js @@ -114,13 +114,13 @@ function buildBabelConfig(filename, options) { type Params = { filename: string, - options: TransformOptions, + options: {+retainLines?: boolean} & TransformOptions, plugins?: BabelPlugins, src: string, }; function transform({filename, options, src}: Params) { - options = options || {}; + options = options || {platform: '', projectRoot: '', inlineRequires: false}; const OLD_BABEL_ENV = process.env.BABEL_ENV; process.env.BABEL_ENV = options.dev ? 'development' : 'production'; @@ -141,6 +141,7 @@ function transform({filename, options, src}: Params) { comments: false, compact: false, filename, + retainLines: !!options.retainLines, sourceFileName: filename, sourceMaps: true, }, src); @@ -166,4 +167,4 @@ function getCacheKey() { module.exports = ({ transform, getCacheKey, -}: Transformer<>); +}: Transformer<{+retainLines?: boolean}>);