floydspace / serverless-esbuild

💨 A Serverless framework plugin to bundle JavaScript and TypeScript with extremely fast esbuild
MIT License
451 stars 139 forks source link

Recent change to package-lock.json path breaks npm workspaces #202

Open chrisui opened 3 years ago

chrisui commented 3 years ago

This change from 5 days ago has broken our builds because with npm workspaces we only have a project-lock.json at the root.

Perhaps this path needs to be variable based on the packager configured.

Originally posted by @chrisui in https://github.com/floydspace/serverless-esbuild/issues/199#issuecomment-930106781

olup commented 3 years ago

Yeah, so I made those changes, and I think we can find a middle ground.

Detection of a local package.json was the logic implemented to detect the use of monorepo. But because it was sought at root level, detection would always fail, what I did was to go back to a local detection. See, it is because I am using a monorepo with workspaces and because I need inclusion of externals that in my case installation with frozen lockfile would throw.

I think I know what your problem would be - but for the sake of drafting a PR that makes sense in every situation, could you please elaborate on your setup? What exactly in your build is broken ? are you using individual packaging? Do you have external libraries listed?