Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: custom esbuild.config.js loader #497

Merged

Conversation

tinchoz49
Copy link
Contributor

Hey guys,

I was trying to update serverless-esbuild to the latest version but I was having issues invoking local functions with serverless invoke local -f <function> and using the custom config esbuild file feature.

custom:
   esbuild:
      config: esbuild.config.js

I was getting this error:

Error: Cannot find module '<project-path>/.esbuild/.build/esbuild.config.js'

And the thing is that only for the pre-local script monkey patching the serviceDir to the build project dir and for that change the require cannot find the esbuild.config.js

I made a simple change, cache the buildOptions.

By doing this we avoid to call the getBuildOptions twice and with the wrong configuration paths.

Copy link
Owner

@floydspace floydspace left a comment

Choose a reason for hiding this comment

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

Hey @tinchoz49 thanks for your other contribution

@floydspace floydspace merged commit 0c7ce8f into floydspace:master Sep 26, 2023
@github-actions
Copy link

🎉 This PR is included in version 1.48.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tinchoz49
Copy link
Contributor Author

thank you @floydspace for the quick release with this fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants