You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kudos to the team which is behind this plugin and the packaging speeds it comes with! 🙇
I have a question (feature-request?) for you. When the below code is packaged, the final deployment does not include the externals (node modules). I think it is because the externals are populated by a plugin in this case esbuild-node-externals.
Is there a way to include node_modules when externals are populated via plugins?
The text was updated successfully, but these errors were encountered:
vamche
changed the title
Include node_modules when externals are populated via plugins (esbuild-node-externals)
Include node_modules when externals are populated via plugins (for eg., esbuild-node-externals)
Jun 10, 2021
Hi @vamche , thank you for the issue and the example. I cloned your repo and indeed the esbuild-node-externals plugin is excluding your dependencies from the bundle, but serverless-esbuild assumes that they are bundled.
I think it makes sense to implement a special case with the plugin, so if it is used we just get the list of modules determined by the plugin and put them to external to have packed.
If you really like to contribute, here is the direction: the plugin has exported function findDependencies you can reuse it to build a list of dependencies to be packed, and then the list must be used in our packExternalModules function which does the job. Should be an easy fix. Thank you 🙏
Kudos to the team which is behind this plugin and the packaging speeds it comes with! 🙇
I have a question (feature-request?) for you. When the below code is packaged, the final deployment does not include the externals (node modules). I think it is because the externals are populated by a plugin in this case
esbuild-node-externals
.https://github.com/vamche/sls-esbuild-node-externals/blob/4cc8843ed9c486727d3c3e89dabc1904ae7521ef/plugins.js#L3-L6
https://github.com/vamche/sls-esbuild-node-externals/blob/4cc8843ed9c486727d3c3e89dabc1904ae7521ef/serverless.yml#L15-L17
Sample repo: https://github.com/vamche/sls-esbuild-node-externals
Is there a way to include
node_modules
when externals are populated via plugins?The text was updated successfully, but these errors were encountered: