mirror of https://github.com/status-im/metro.git
Dont build sourcemap stuff if it wont be used
Summary: Don't bother to work on the source map if it won't be used anyways Reviewed By: rafeca Differential Revision: D6884244 fbshipit-source-id: ac014bf982e33c669a1e79f16dd06149e758a797
This commit is contained in:
parent
5e505980ec
commit
eb08ed4adc
|
@ -66,21 +66,26 @@ function saveAsAssets(
|
||||||
);
|
);
|
||||||
writeUnbundle.then(() => log('Done writing unbundle output'));
|
writeUnbundle.then(() => log('Done writing unbundle output'));
|
||||||
|
|
||||||
const sourceMap = buildSourceMapWithMetaData({
|
if (sourcemapOutput) {
|
||||||
fixWrapperOffset: true,
|
const sourceMap = buildSourceMapWithMetaData({
|
||||||
lazyModules: lazyModules.concat(),
|
fixWrapperOffset: true,
|
||||||
moduleGroups: null,
|
lazyModules: lazyModules.concat(),
|
||||||
startupModules: startupModules.concat(),
|
moduleGroups: null,
|
||||||
});
|
startupModules: startupModules.concat(),
|
||||||
if (sourcemapSourcesRoot !== undefined) {
|
});
|
||||||
relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
|
if (sourcemapSourcesRoot !== undefined) {
|
||||||
}
|
relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
|
||||||
|
}
|
||||||
|
const wroteSourceMap = writeSourceMap(
|
||||||
|
sourcemapOutput,
|
||||||
|
JSON.stringify(sourceMap),
|
||||||
|
log,
|
||||||
|
);
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([writeUnbundle, wroteSourceMap]);
|
||||||
writeUnbundle,
|
} else {
|
||||||
sourcemapOutput &&
|
return writeUnbundle;
|
||||||
writeSourceMap(sourcemapOutput, JSON.stringify(sourceMap), log),
|
}
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDir(dirName) {
|
function createDir(dirName) {
|
||||||
|
|
Loading…
Reference in New Issue