mirror of https://github.com/status-im/metro.git
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
This commit is contained in:
parent
d437b31fea
commit
20ed5b8d3a
|
@ -114,13 +114,13 @@ function buildBabelConfig(filename, options) {
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
filename: string,
|
filename: string,
|
||||||
options: TransformOptions,
|
options: {+retainLines?: boolean} & TransformOptions,
|
||||||
plugins?: BabelPlugins,
|
plugins?: BabelPlugins,
|
||||||
src: string,
|
src: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
function transform({filename, options, src}: Params) {
|
function transform({filename, options, src}: Params) {
|
||||||
options = options || {};
|
options = options || {platform: '', projectRoot: '', inlineRequires: false};
|
||||||
|
|
||||||
const OLD_BABEL_ENV = process.env.BABEL_ENV;
|
const OLD_BABEL_ENV = process.env.BABEL_ENV;
|
||||||
process.env.BABEL_ENV = options.dev ? 'development' : 'production';
|
process.env.BABEL_ENV = options.dev ? 'development' : 'production';
|
||||||
|
@ -141,6 +141,7 @@ function transform({filename, options, src}: Params) {
|
||||||
comments: false,
|
comments: false,
|
||||||
compact: false,
|
compact: false,
|
||||||
filename,
|
filename,
|
||||||
|
retainLines: !!options.retainLines,
|
||||||
sourceFileName: filename,
|
sourceFileName: filename,
|
||||||
sourceMaps: true,
|
sourceMaps: true,
|
||||||
}, src);
|
}, src);
|
||||||
|
@ -166,4 +167,4 @@ function getCacheKey() {
|
||||||
module.exports = ({
|
module.exports = ({
|
||||||
transform,
|
transform,
|
||||||
getCacheKey,
|
getCacheKey,
|
||||||
}: Transformer<>);
|
}: Transformer<{+retainLines?: boolean}>);
|
||||||
|
|
Loading…
Reference in New Issue