Skip to content

Instantly share code, notes, and snippets.

@webjay
Created October 1, 2022 11:54
Show Gist options
  • Save webjay/b54214a7ac599e2dde6586d8a204747b to your computer and use it in GitHub Desktop.
Save webjay/b54214a7ac599e2dde6586d8a204747b to your computer and use it in GitHub Desktop.
@mrgrain/cdk-esbuild example
const datasourceLayer = new LayerVersion(this, id + 'DatasourceLayer', {
code: new TypeScriptCode('./src/layers/datasource/datasource.ts', {
buildOptions: {
external: [
'pg-native',
'pg',
'typeorm',
'typeorm-aurora-data-api-driver',
],
// keepNames: true,
minify: true,
platform: 'node',
target: 'node14',
},
copyDir: './src/layers/datasource/',
}),
layerVersionName: `${this.stackName}-datasource-layer`,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment