Skip to content

Commit

Permalink
fix(bundling): enclosing paths with quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Richter committed Jan 3, 2025
1 parent 364ce86 commit f62e4dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-lambda-nodejs/lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ export class Bundling implements cdk.BundlingOptions {
...defines.map(([key, value]) => `--define:${key}=${JSON.stringify(value)}`),
...this.props.logLevel ? [`--log-level=${this.props.logLevel}`] : [],
...this.props.keepNames ? ['--keep-names'] : [],
...this.relativeTsconfigPath ? [`--tsconfig=${pathJoin(options.inputDir, this.relativeTsconfigPath)}`] : [],
...this.props.metafile ? [`--metafile=${pathJoin(options.outputDir, 'index.meta.json')}`] : [],
...this.relativeTsconfigPath ? [`--tsconfig="${pathJoin(options.inputDir, this.relativeTsconfigPath)}"`] : [],
...this.props.metafile ? [`--metafile="${pathJoin(options.outputDir, 'index.meta.json')}"`] : [],
...this.props.banner ? [`--banner:js=${JSON.stringify(this.props.banner)}`] : [],
...this.props.footer ? [`--footer:js=${JSON.stringify(this.props.footer)}`] : [],
...this.props.mainFields ? [`--main-fields=${this.props.mainFields.join(',')}`] : [],
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ test('esbuild bundling with esbuild options', () => {
'--target=es2020 --platform=node --format=esm --outfile="/asset-output/index.mjs"',
`--minify --sourcemap --sources-content=false --external:${STANDARD_EXTERNAL} --loader:.png=dataurl`,
defineInstructions,
'--log-level=silent --keep-names --tsconfig=/asset-input/lib/custom-tsconfig.ts',
'--metafile=/asset-output/index.meta.json --banner:js="/* comments */" --footer:js="/* comments */"',
'--log-level=silent --keep-names --tsconfig="/asset-input/lib/custom-tsconfig.ts"',
'--metafile="/asset-output/index.meta.json" --banner:js="/* comments */" --footer:js="/* comments */"',
'--main-fields=module,main --inject:"./my-shim.js" --inject:"./path with space/second-shim.js"',
'--log-limit="0" --resolve-extensions=".ts,.js" --splitting --keep-names --out-extension:".js=.mjs"',
].join(' '),
Expand Down Expand Up @@ -777,7 +777,7 @@ test('esbuild bundling with projectRoot', () => {
bundling: expect.objectContaining({
command: [
'bash', '-c',
`esbuild --bundle "/asset-input/lib/index.ts" --target=${STANDARD_TARGET} --platform=node --outfile="/asset-output/index.js" --external:${STANDARD_EXTERNAL} --tsconfig=/asset-input/lib/custom-tsconfig.ts`,
`esbuild --bundle "/asset-input/lib/index.ts" --target=${STANDARD_TARGET} --platform=node --outfile="/asset-output/index.js" --external:${STANDARD_EXTERNAL} --tsconfig="/asset-input/lib/custom-tsconfig.ts"`,
],
}),
});
Expand Down

0 comments on commit f62e4dd

Please sign in to comment.