Skip to content
v2.277.0

ICommandHooks Interface ​

Command hooks.

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:

text
afterBundling(inputDir: string, outputDir: string): string[]{
  return [`cp ${inputDir}/my-binary.node ${outputDir}`];
}

Methods ​

afterBundling(inputDir: string, outputDir: string): string[]def after_bundling(self, input_dir: str, output_dir: str) -> typing.List[str]public List<String> afterBundling(String inputDir, String outputDir)public string[] AfterBundling(string inputDir, string outputDir)func AfterBundling(InputDir *string, OutputDir *string) *[]*string #
Returns commands to run after bundling.

Commands are chained with &&.

beforeBundling(inputDir: string, outputDir: string): string[]def before_bundling(self, input_dir: str, output_dir: str) -> typing.List[str]public List<String> beforeBundling(String inputDir, String outputDir)public string[] BeforeBundling(string inputDir, string outputDir)func BeforeBundling(InputDir *string, OutputDir *string) *[]*string #
Returns commands to run before bundling.

Commands are chained with &&.

beforeInstall(inputDir: string, outputDir: string): string[]def before_install(self, input_dir: str, output_dir: str) -> typing.List[str]public List<String> beforeInstall(String inputDir, String outputDir)public string[] BeforeInstall(string inputDir, string outputDir)func BeforeInstall(InputDir *string, OutputDir *string) *[]*string #
Returns commands to run before installing node modules.

This hook only runs when node modules are installed.

Commands are chained with &&.