This chapter will introduce the build steps for deploying Pages and how it works.
When creating a project using a preset template, Pages will use the template's default configuration for building; for imported GitHub repositories, Pages will automatically identify the used framework and apply the most common build configuration.
If you need specific settings, you can customize the root directory, compilation command, and output directory parameters when creating a new project or in project settings.
You can start Pages deployment in two ways:
Push code changes to GitHub
Start redeployment inside the console
Building Settings
You can specify how Pages builds your project in "Project Settings - Build deployment configuration".
Framework Preset
Select a preset framework from the pull-down menu to quickly fill in each configuration item. After selecting a framework, you can still continue to adjust other configurations.
Root Directory
The root directory is the path for executing compilation commands. If not set, it defaults to the root directory of the repository ./.
Output Directory
The output directory is the path where build artifacts (such as HTML files and static resources) are stored. This directory is relative to the root directory, and defaults to root ( / ). You can query the output directory corresponding to different frameworks through the framework guide.
Compilation Command
Pages will automatically set the compilation command based on the selected framework, for example npm run build. The compilation command will run in the Bash shell, and you can also add Bash-compatible syntax.
For compilation commands corresponding to different frameworks, please refer to the framework guide.
Installation Command
Pages automatically detects the installation command during the build process and installs dependencies from package.json. By default, it uses npm install.
Currently supported package managers are as follows:
Package Manager
Lock File
Installation Command
Supported Editions
Yarn
yarn.lock
yarn install
1
npm
package-lock.json
npm install
8, 9, 10
pnpm
pnpm-lock.yaml
pnpm install
6, 7, 8, 9
Node Version
Pages comes pre-installed with node versions 14.21.3, 16.20.2, 18.20.4, 20.18.0, and 22.11.0. You can select a version in Project Settings - node.js Version.
Note:
Pre-installed node versions include package managers such as pnpm, yarn, and bun. If there is an .nvmrc file in the project root directory, it will automatically download and switch to the specified version, but does not include the corresponding package manager.
Environment Variables
Pages supports using environment variables to build your project. Each environment variable consists of a variable name and a variable value. Currently, these variables are valid for all environments.
If you need to import environment variables in batches, you can paste all environment variables from the .env file into the variable name input box, and Pages will automatically identify them.
Note:
Any changes you make to environment variables will not affect previous deployments. These changes apply only to new deployments.
The length limit of a variable name is 255 bytes. The length limit of a variable value is 500 bytes.