Build Everything(including Deps) To Specific Directory?

I’m currently trying to build a GCP Cloud Function using ReScript.

The current problem is that it is not possible to import BuckleScript dependencies.

It’s because GCP runs yarn install again when the hash of node_modules have been changed after running the build script(specified with gcp-build npm script), results in clearing all the built .bs.js files for the dependencies.

Therefore I tried to move all the build output to specific directory like dist/ but haven’t find any bsconfig options for it. Is there any? Or is it impossible? In that case I probably should write a transformer to move all the .bs.jses and replace all the imports to .bs.jses… but that sounds terrible.

I solved the problem by including all of the depencies inside my source directory. However this should be considered as a workaround IMO

I think people normally use a bundler to output a single bundle .js file to run on the lambda.

Yeah probably should consider that approach…