serverless-esbuild
serverless-esbuild copied to clipboard
serverless-esbuild should expose lifecycle events to be hookable
After looking for lifecycleEvents
in the source code, I didn't find any hookable events I could use to customize the serverless-esbuild
plugin behavior.
However it is common best practice to expose such events when you write a plugin (See here).
For example, serverless-offline
exposes init
, ready
and end
event that serverless-esbuild
actually uses to build the module before launching serverless-offline (See here).
I would need this hook to copy some static assets before bundling the package with esbuild
.
Let me know if you want me to open the PR.
Hi @gabsn, I have in mind to implement this similar way like serverless-webpack
does, but cannot currently focus on it. I would appreciate your effort if you're willing to contribute.
Sorry finally I decided to go with serverless-scriptable-plugin
and:
scriptable:
hooks:
# serverless
before:deploy:deploy: yarn build
before:invoke:local:invoke: yarn build
# serverless-offline
before:offline:start: yarn dynamodb:start & yarn watch &
Then in my build command I can use esbuild with its native config.