Generate source maps for releases
Summary: Allows for optional generation of source maps while building plugins. Caveat: This will leave a broken `//# sourceMappingURL` comment at the bottom. If you set it to `null`, as the documentation suggests, you will instead get an inlined source map in addition to the written one. Reviewed By: nikoant Differential Revision: D29265385 fbshipit-source-id: 1e21e49d2516ecc5909b086e7797736b298b86ab
This commit is contained in:
committed by
Facebook GitHub Bot
parent
640e06f130
commit
8df81d2dc0
@@ -53,6 +53,11 @@ const argv = yargs
|
||||
type: 'string',
|
||||
alias: 'ou',
|
||||
},
|
||||
'output-sourcemap': {
|
||||
description: 'File path for the sourcemap to be written. Optional.',
|
||||
type: 'string',
|
||||
alias: 'os',
|
||||
},
|
||||
})
|
||||
.help()
|
||||
.strict()
|
||||
@@ -65,9 +70,10 @@ async function buildPlugin() {
|
||||
const outputFileArg = argv.output;
|
||||
const outputUnpackedArg = argv['output-unpacked'];
|
||||
const minFlipperVersion = argv['min-flipper-version'];
|
||||
const outputSourcemapArg = argv['output-sourcemap'];
|
||||
const packageJsonPath = path.join(pluginDir, 'package.json');
|
||||
const packageJsonOverridePath = path.join(pluginDir, 'fb', 'package.json');
|
||||
await runBuild(pluginDir, false);
|
||||
await runBuild(pluginDir, false, {sourceMapPath: outputSourcemapArg});
|
||||
const checksum = await computePackageChecksum(pluginDir);
|
||||
if (previousChecksum !== checksum && argv.version) {
|
||||
console.log(`Plugin changed. Packaging new version ${argv.version}...`);
|
||||
|
||||
Reference in New Issue
Block a user