The issue:
- Esbuild allows using plugins during build step via a special config’s property: #1
- At the same time there’s an option to configure esbuild options in AWS CDK: #2
- But the type of esbuild configuration in AWS CDK does not include an explicit option to allow plugins: #3
- It allows an option to set any other CLI flags with the
esbuildArgs
property, though: #4 - But it looks like esbuild would not allow plugin configuration via the CLI flags.
Is there a way to circumvent this somehow?
P. S. Although it makes the question less generic, but to add more context: I was thinking if it’s possible to replace import.meta.dirname
tokens with the actual string values on the build step, because these guys become completely useless once all the files are being build into one (to run within Lambda).