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

Allow additional files via options #13

Closed
mishabruml opened this issue Jun 26, 2022 · 1 comment · Fixed by #14
Closed

Allow additional files via options #13

mishabruml opened this issue Jun 26, 2022 · 1 comment · Fixed by #14

Comments

@mishabruml
Copy link
Contributor

mishabruml commented Jun 26, 2022

Hey this is a great plugin and is helping me solve my issue using typeorm migrations with esbuild. Detailed info here floydspace/serverless-esbuild#328

I have a usecase using https://www.npmjs.com/package/serverless-esbuild where I don't have access to the entryPoints array, but you can provide esbuild plugins https://www.npmjs.com/package/serverless-esbuild#esbuild-plugins. The typeorm migrations files need importing to be available at lambda runtime, but because esbuild doesn't support statically analysing the dynamic imports produced by providing a glob for typeorm migrations option, there needs to be another way to make sure the files are bundled by esbuild.

It would be great if for this plugin you could provide glob patterns via plugin options. I have done a proof of concept here https://github.com/mishabruml/typeorm-playground/blob/master/sls-esbuild-plugins/additionalEntrypointsGlobPlugin.ts which is working for me. I would love to make a PR and include this functionality into your plugin. The additionalEntrypoints could simply be added to the GlobPluginOptions interface? And then most of the logic I have implemented should be fairly simple to incorporate.

Cheers!

@waspeer
Copy link
Owner

waspeer commented Jun 26, 2022

Hi @mishabruml :) That sounds like a good addition! It would be great if you could make a PR for this with a test covering this case. But do let me know if you run into any problems or if I can help out in any way.

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 a pull request may close this issue.

2 participants