MI-246: Bundle lambda code using vite - #1104
Conversation
|
Looks good, Kai 👏 I've tried to run this locally, but seem to be unable to deploy a blank service: |
|
@kai-nguyen-aligent I'm excited for this! Let us know when the build check is passing? |
|
LGTM! |
tvhees
left a comment
There was a problem hiding this comment.
Some questions for you kai, approving ahead of time if you don't think there are any changes required as a result.
| const environment = { | ||
| ...props.environment, | ||
| ...(props.bundling?.sourceMap ? { NODE_OPTIONS: '--enable-source-maps' } : {}), | ||
| ...(this.configuration.sourceMap ? { NODE_OPTIONS: '--enable-source-maps' } : {}), |
There was a problem hiding this comment.
Do you think we need to do a proper deep merge with construct props? Technically this would clobber any other NODE_OPTIONS value.
Can be left for future work.
There was a problem hiding this comment.
Let's do it in future work. Normally, we don't really need to set any NODE_OPTIONS in Production except this.
There was a problem hiding this comment.
I think we might be able to remove experimentalDecorators: true now?
There was a problem hiding this comment.
Vite stills use esbuild for some tasks behind the scene. I'll follow up on this to see if we still need it or not.
d7b3b5a
|
@tvhees I have to explicitly set module, target and moduleResolution in the
|
This will handle nested folders in a more predictable way when bundling and resolving paths
…path-for-bundled-handlers Feature/mi 246 retain relative path for bundled handlers
tvhees
left a comment
There was a problem hiding this comment.
This is passing all my dev testing. Nice work :)
Summary
This PR introduces new way to bundle lambda runtime code using Vite, and several configurations to improve bundling, and deployment.
Changes
deployscript is dependent on build script. This is also managed by Nx.libs/cdk-utils/package.json. This removed the confusion when importing from this package.bundleconfiguration as we now use Vite to bundle our lambda runtime code.