Container

Configuration properties that after tasks run by the container in a cloud project.

The container runs a number of tasks to set up the environment for your framework code to run. The options here provide the ability to customize these tasks.

Container Hooks

The container runs through a series of tasks to get your framework up and running. These commands can be customized using the properties below.

installCommand

Replaces Netlify Create's default installation action.

Required
No
Allowed Values
String specifying the command to use to replace the dependency installation process.
Default

Inferred from environment context, following this logic:

  1. Use Yarn if there is a yarn.lock file in the project root. And if a .yarnrc.yml file contains .yarn/releases/yarn-berry.cjs, use Yarn v2.
  2. Otherwise, run npm install.
  • 1
  • 2
  • 3
export default {
  installCommand: 'npm install',
}

postGitCloneCommand

The command to run after cloning the Git repository, and before preInstallCommand.

Required
No
Allowed Values
String specifying the command to run.
Default
undefined
  • 1
  • 2
  • 3
export default {
  postGitCloneCommand: 'node ./scripts/git-setup.js',
}
  • The command is run from the repository's root directory.
  • Node version will be set by the nodeVersion property.
  • Unless handled separately, dependencies are not yet installed and will not be available.

postInstallCommand

A task to run after running the installCommand and before starting the framework development server (devCommand).

Required
No
Allowed Values
String specifying the command to run.
Default
undefined
  • 1
  • 2
  • 3
export default {
  postInstallCommand: 'npm run cleanup',
}
  • The command is run from the repository's root directory.
  • Node version will be set by the nodeVersion property.

preInstallCommand

A task to run before running the installCommand

Required
No
Allowed Values
String specifying the command to run.
Default
undefined
  • 1
  • 2
  • 3
export default {
  preInstallCommand: 'node ./scripts/setup.js',
}
  • The command is run from the repository's root directory.
  • Node version will be set by the nodeVersion property.
  • Unless handled separately, dependencies are not yet installed and will not be available.