diff --git a/desktop/scripts/build-flipper-server-release.tsx b/desktop/scripts/build-flipper-server-release.tsx index bfce3f987..05256d4aa 100644 --- a/desktop/scripts/build-flipper-server-release.tsx +++ b/desktop/scripts/build-flipper-server-release.tsx @@ -225,7 +225,6 @@ async function copyStaticResources(outDir: string, versionNumber: string) { 'icons.json', 'index.web.dev.html', 'index.web.html', - 'manifest.json', 'offline.html', 'service-worker.js', 'style.css', @@ -239,6 +238,13 @@ async function copyStaticResources(outDir: string, versionNumber: string) { fs.copy(path.join(staticDir, e), path.join(outDir, 'static', e)), ), ); + + // Manifest needs to be copied over to static folder with the correct name. + await fs.copy( + path.join(staticDir, 'manifest.template.json'), + path.join(outDir, 'static', 'manifest.json'), + ); + console.log('✅ Copied static resources.'); } diff --git a/desktop/scripts/start-flipper-server-dev.tsx b/desktop/scripts/start-flipper-server-dev.tsx index 9e9623cb4..fd407495d 100644 --- a/desktop/scripts/start-flipper-server-dev.tsx +++ b/desktop/scripts/start-flipper-server-dev.tsx @@ -19,6 +19,7 @@ import isFB from './isFB'; import yargs from 'yargs'; import ensurePluginFoldersWatchable from './ensurePluginFoldersWatchable'; import {Watchman} from 'flipper-pkg-lib'; +import fs from 'fs-extra'; const argv = yargs .usage('yarn flipper-server [args]') @@ -94,6 +95,16 @@ if (argv['enabled-plugins'] !== undefined) { let startCount = 0; +async function copyStaticResources() { + console.log(`⚙️ Copying necessary static resources`); + const staticDir = path.resolve(__dirname, '..', 'static'); + + await fs.copy( + path.join(staticDir, 'manifest.template.json'), + path.join(staticDir, 'manifest.json'), + ); +} + async function restartServer() { try { await compileServerMain(true); @@ -156,9 +167,8 @@ async function startWatchChanges() { process.env.FLIPPER_RELEASE_CHANNEL === 'insiders', ); + await copyStaticResources(); await ensurePluginFoldersWatchable(); - // builds and starts await restartServer(); - // watch await startWatchChanges(); })(); diff --git a/desktop/static/manifest.json b/desktop/static/manifest.template.json similarity index 100% rename from desktop/static/manifest.json rename to desktop/static/manifest.template.json