Build Configuration
When deployment is triggered, CloudBase Webify will automatically build your Web application. CloudBase Webify provides preset configurations for many frontend frameworks, and you can also customize your build configuration.
Preset Configuration
CloudBase Webify currently provides preset configurations for the following frameworks:
- React(create-react-app)
- Vue(vue-cli)
- Hexo
For example, if you select React
as the preset configuration, the following behaviors will occur during the build:
- Run
npm run install
to install dependencies. - Run
npm run build
to build the project. - After the build is completed, the artifacts in the
build
directory will be deployed to the Web application hosting platform.
Custom Build Configuration
Build configuration includes the following configuration items:
- Build Command
- Output Directory
- Install Command
Build Command
The command executed during the build phase, with the default value being npm run build
.
Some simple web applications (pure HTML/JS/CSS) may not have a build process. You can set the build command to empty to skip the build phase.
Output Directory
The directory where build artifacts are located after the application is built (which typically contains an index.html
file, the website's homepage).
All files in the directory will be deployed to the Web application hosting platform.
Some simple web applications (pure HTML/JS/CSS) may not have a build artifacts directory. You can set the build directory to .
(project root directory) to directly deploy files under the project root directory.
Install Command
The command executed during the build phase to install dependencies, with the default value being npm install
.
During the build phase, the platform will first install the project dependencies specified in package.json
for your application (including development environment dependencies devDependencies
).
You can also run a custom publish command within this command, for example, to publish some of your resources to a third-party platform.