feat: add skipEsbuild option on a per function level #423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use case:
I've got multiple projects where I'm using serverless-esbuild and it's working great. But I'm building my own custom plugin for these projects where I'm adding a function and defining my own artifact zip file. Turns out though, serverless-esbuild will try to run esbuild even if an artifact is already defined. I'm sure this use case wasn't something that was thought of in the beginning, but I feel like it's something this should account for.
This has also been brought up in #376
Solution:
I tried going a variety of different routes, but the best solution I have so far is to make it so you can set a property when you define the function called
skipEsbuild
and if it'strue
, then it'll just skip over it. I'm leveraging the Serverless schema configuration helpers so that some default validation takes place.I'm still pretty new to TypeScript and all, so if I did something incorrect here, let me know!