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'));
|
||||
|
||||
const sourceMap = buildSourceMapWithMetaData({
|
||||
fixWrapperOffset: true,
|
||||
lazyModules: lazyModules.concat(),
|
||||
moduleGroups: null,
|
||||
startupModules: startupModules.concat(),
|
||||
});
|
||||
if (sourcemapSourcesRoot !== undefined) {
|
||||
relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
|
||||
}
|
||||
if (sourcemapOutput) {
|
||||
const sourceMap = buildSourceMapWithMetaData({
|
||||
fixWrapperOffset: true,
|
||||
lazyModules: lazyModules.concat(),
|
||||
moduleGroups: null,
|
||||
startupModules: startupModules.concat(),
|
||||
});
|
||||
if (sourcemapSourcesRoot !== undefined) {
|
||||
relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
|
||||
}
|
||||
const wroteSourceMap = writeSourceMap(
|
||||
sourcemapOutput,
|
||||
JSON.stringify(sourceMap),
|
||||
log,
|
||||
);
|
||||
|
||||
return Promise.all([
|
||||
writeUnbundle,
|
||||
sourcemapOutput &&
|
||||
writeSourceMap(sourcemapOutput, JSON.stringify(sourceMap), log),
|
||||
]);
|
||||
return Promise.all([writeUnbundle, wroteSourceMap]);
|
||||
} else {
|
||||
return writeUnbundle;
|
||||
}
|
||||
}
|
||||
|
||||
function createDir(dirName) {
|
||||
|
|
Loading…
Reference in New Issue