0x80 / firebase-tools-with-isolate

The Firebase CLI with isolate-package integrated to support monorepos
MIT License
24 stars 0 forks source link

Isolate executes twice if v1 and v2 functions are being mixed #14

Closed 0x80 closed 1 day ago

0x80 commented 1 day ago

Because the isolate process is called in prepareFunctionsUpload it is executed twice if you mix 1st and 2nd gen functions.

if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv2")) {
      const packagedSource = await prepareFunctionsUpload(sourceDir, config);
      source.functionsSourceV2 = packagedSource?.pathToSource;
      source.functionsSourceV2Hash = packagedSource?.hash;
    }
    if (backend.someEndpoint(wantBackend, (e) => e.platform === "gcfv1")) {
      const packagedSource = await prepareFunctionsUpload(sourceDir, config, runtimeConfig);
      source.functionsSourceV1 = packagedSource?.pathToSource;
      source.functionsSourceV1Hash = packagedSource?.hash;
    }

So we should move it outside.