Fix release build

Summary:
This diff fixes the issue where flipper-server didn't properly build when creating a release build, due to plugins being resolved from both source `desktop/plugins` and `desktop/static/defaultPlugins` folders.

The `desktop/plugins` folder should not be included in the build, but wasn't sure why not, as it isn't a problem for desktop release either?

Anyway solved it for now to unblock releasing by using bundled-plugins, which might actually be better anyway for a bunch of use cases of flipper-server (e.g. when installed to an OD). So I think this is fine for now.

It does increase the build to ~40 MB, which is still halve of our unbundled electron build.

Reviewed By: aigoncharov

Differential Revision: D33427938

fbshipit-source-id: c931c2d1bea1e04c7b1603a488dcb76a41488740
This commit is contained in:
Michel Weststrate
2022-01-10 08:56:54 -08:00
committed by Facebook GitHub Bot
parent 3d86280686
commit b05219d09c
3 changed files with 60 additions and 33 deletions

View File

@@ -454,7 +454,7 @@ export async function buildBrowserBundle(outDir: string, dev: boolean) {
const baseConfig = await Metro.loadConfig();
const config = Object.assign({}, baseConfig, {
projectRoot: rootDir,
projectRoot: browserUiDir,
watchFolders,
transformer: {
...baseConfig.transformer,
@@ -553,7 +553,8 @@ function assertSaneImport(context: any, moduleName: string) {
(moduleName.startsWith('metro') &&
!moduleName.startsWith('metro-runtime')) ||
moduleName === 'Metro' ||
moduleName.startsWith('babel') ||
(moduleName.startsWith('babel') &&
!moduleName.startsWith('babel-runtime')) ||
moduleName.startsWith('typescript') ||
moduleName.startsWith('electron') ||
moduleName.startsWith('@testing-library')