Skip to content

Conversation

kevpie
Copy link

@kevpie kevpie commented Sep 25, 2025

Copies the relevant patches to the isolate folder along with package.json section.

Probably a better way to do this.
For now I force firebase-tools-with-isolate to provide the right config using a patch like this.

diff --git a/lib/deploy/functions/prepareFunctionsUpload.js b/lib/deploy/functions/prepareFunctionsUpload.js
index f6cf911cd7d67983e57b50aa05a8289d4da6484b..b417d22524588ffb93fe221dae49590de9b762b4 100644
--- a/lib/deploy/functions/prepareFunctionsUpload.js
+++ b/lib/deploy/functions/prepareFunctionsUpload.js
@@ -99,9 +99,12 @@ async function runIsolate(sourceDirName) {
     try {
         utils.logLabeledBullet("isolate", `Isolating the source`);
         const { isolate } = (await (0, dynamicImport_1.dynamicImport)("isolate-package"));
+        console.log("isolateDir!!", sourceDirName);
         const isolateDir = await isolate(sourceDirName !== "."
             ? {
                 targetPackagePath: path.join("./", sourceDirName),
+                includePatchedDependencies: true,
+                workspaceRoot: "..",
             }
             : undefined);
         utils.logLabeledBullet("isolate", `Finished isolation at ${clc.bold(isolateDir)}`);

- Add @esbuild-plugins/tsconfig-paths to handle ~/lib/* imports
- Use createRequire to import CommonJS plugin in ESM context
- Resolves build failures in CI environments where baseUrl context differs
clean: true,
esbuildPlugins: [tsconfigPathsPlugin({})],
// shims: true, // replaces use of import.meta
/**
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building inside a pnpm install that has a newer version of esbuild. Esbuild struggles with the paths without the plugin to hoist in the paths from tsconfig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant