Add sourcemap support to server build

Summary:
Provide the same build parameters as for the main build and move
the two bundles to a folder where we can pick them up.

For consistency, I'm keeping the naming scheme with the main build.

Reviewed By: antonk52

Differential Revision: D36521046

fbshipit-source-id: 9ea992d6e5dc299d88083d751ca8e84eadb1430b
This commit is contained in:
Pascal Hartig
2022-05-20 04:04:06 -07:00
committed by Facebook GitHub Bot
parent 3dbd3f43e1
commit 02adfa79e9
2 changed files with 33 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ import {
getVersionNumber,
prepareDefaultPlugins,
prepareHeadlessPlugins,
moveServerSourceMaps,
} from './build-utils';
import {defaultPluginsDir, distDir, serverDir, staticDir} from './paths';
import isFB from './isFB';
@@ -98,6 +99,11 @@ const argv = yargs
'Directory with prepared list of default plugins which will be included into the Flipper distribution as "defaultPlugins" dir',
type: 'string',
},
'source-map-dir': {
describe:
'Directory to write the main.bundle.map and bundle.map files for the main and render bundle sourcemaps, respectively',
type: 'string',
},
version: {
description:
'Unique build identifier to be used as the version patch part for the build',
@@ -335,6 +341,7 @@ async function buildServerRelease() {
await copyStaticResources(dir, versionNumber);
await downloadIcons(path.join(dir, 'static'));
await buildBrowserBundle(path.join(dir, 'static'), false);
await moveServerSourceMaps(dir, argv['source-map-dir']);
await modifyPackageManifest(dir, versionNumber, hgRevision, argv.channel);
const archive = await packNpmArchive(dir, versionNumber);
await runPostBuildAction(archive, dir);