Interface ICommandHooks
Command hooks.
Namespace: Amazon.CDK.AWS.Lambda.Nodejs
Assembly: Amazon.CDK.AWS.Lambda.Nodejs.dll
Syntax (csharp)
public interface ICommandHooks
Syntax (vb)
Public Interface ICommandHooks
Remarks
These commands will run in the environment in which bundling occurs: inside the container for Docker bundling or on the host OS for local bundling.
Commands are chained with &&
.
The following example (specified in TypeScript) copies a file from the input directory to the output directory to include it in the bundled asset:
afterBundling(inputDir: string, outputDir: string): string[]{
return [`cp ${inputDir}/my-binary.node ${outputDir}`];
}
Synopsis
Methods
AfterBundling(String, String) | Returns commands to run after bundling. |
BeforeBundling(String, String) | Returns commands to run before bundling. |
BeforeInstall(String, String) | Returns commands to run before installing node modules. |
Methods
AfterBundling(String, String)
Returns commands to run after bundling.
string[] AfterBundling(string inputDir, string outputDir)
Parameters
- inputDir System.String
- outputDir System.String
Returns
System.String[]
Remarks
Commands are chained with &&
.
BeforeBundling(String, String)
Returns commands to run before bundling.
string[] BeforeBundling(string inputDir, string outputDir)
Parameters
- inputDir System.String
- outputDir System.String
Returns
System.String[]
Remarks
Commands are chained with &&
.
BeforeInstall(String, String)
Returns commands to run before installing node modules.
string[] BeforeInstall(string inputDir, string outputDir)
Parameters
- inputDir System.String
- outputDir System.String
Returns
System.String[]
Remarks
This hook only runs when node modules are installed.
Commands are chained with &&
.