mirror of https://github.com/status-im/metro.git
Dont relativate source map if it wont be used
Summary: Don't bother to work on the source map if it won't be used anyways Reviewed By: mjesun Differential Revision: D6884243 fbshipit-source-id: 483664ad32a72a8e6e3de3e0cc224b3a6ea67d46
This commit is contained in:
parent
92e9cfa050
commit
b1372a37bd
|
@ -53,13 +53,6 @@ function saveBundleAndMap(
|
|||
sourcemapSourcesRoot,
|
||||
} = options;
|
||||
|
||||
let {map} = bundle;
|
||||
if (sourcemapSourcesRoot !== undefined) {
|
||||
log('start');
|
||||
map = createCodeWithMap(map, sourcemapSourcesRoot);
|
||||
log('finish');
|
||||
}
|
||||
|
||||
log('Writing bundle output to:', bundleOutput);
|
||||
|
||||
const {code} = bundle;
|
||||
|
@ -74,6 +67,13 @@ function saveBundleAndMap(
|
|||
);
|
||||
|
||||
if (sourcemapOutput) {
|
||||
let {map} = bundle;
|
||||
if (sourcemapSourcesRoot !== undefined) {
|
||||
log('start relativating source map');
|
||||
map = createCodeWithMap(map, sourcemapSourcesRoot);
|
||||
log('finished relativating');
|
||||
}
|
||||
|
||||
log('Writing sourcemap output to:', sourcemapOutput);
|
||||
const writeMap = writeFile(sourcemapOutput, map, null);
|
||||
writeMap.then(() => log('Done writing sourcemap output'));
|
||||
|
|
Loading…
Reference in New Issue