(options: BundlingProps)
| 52 | */ |
| 53 | export class Bundling implements cdk.BundlingOptions { |
| 54 | public static bundle(options: BundlingProps): AssetCode { |
| 55 | const projectRoot = dirname(options.manifestPath); |
| 56 | const bundling = new Bundling(projectRoot, options); |
| 57 | |
| 58 | return Code.fromAsset(projectRoot, { |
| 59 | assetHashType: options.assetHashType ?? cdk.AssetHashType.OUTPUT, |
| 60 | assetHash: options.assetHash, |
| 61 | bundling: { |
| 62 | image: bundling.image, |
| 63 | command: bundling.command, |
| 64 | environment: bundling.environment, |
| 65 | local: bundling.local, |
| 66 | // Overwrite properties which are defined from the docker options. |
| 67 | ...Object.fromEntries( |
| 68 | Object.entries(options.dockerOptions ?? {}).filter( |
| 69 | ([_, value]) => value !== undefined, |
| 70 | ), |
| 71 | ), |
| 72 | }, |
| 73 | }); |
| 74 | } |
| 75 | |
| 76 | public static clearRunsLocallyCache(): void { // for tests |
| 77 | this.runsLocally = undefined; |
no outgoing calls
no test coverage detected