-
Notifications
You must be signed in to change notification settings - Fork 152
Description
Describe your idea/feature/enhancement
Maybe there's a way to already do this, but I can't figure out it out...
When building and packaging a Lambda function, provide the capability to package resource files with the package to deploy. My need is for esbuild, but this may be useful for other workflows as well.
For example, in Metadata, add an optional property to Include files, which would be a list of globs to include in the output. Directories/files would be copied in with relative paths (i.e. copying "./my-resources/*.res" would create "{output dir}/my-resources/foo1.res", "{output dir}/my-resources/foo2.res", etc.
MyLambda:
Type: AWS::Serverless::Function
Metadata:
Include:
- ./my-resources/*.res
BuildMethod: esbuild
BuildProperties:
Minify: true
Target: "es2017"
Sourcemap: false
EntryPoints:
- ./src/index.ts
UseNpmCi: true Proposal
- Add new Purpose - COPY_RESOURCES
- In NodejsNpmEsbuildWorkflow.Init, check for kwargs.options.include
- If kwargs.options.include is defined, add an action to list of self.actions, after subprocess_esbuild, copy specified directories/files to the artifacts director
Additional Details
May require creation of OSUtils.glob wrapper. If that's problematic, we could stick with specific directory/file names
I'm happy to do the initial lift on this if the concept sounds viable.