Builder provides a wealth of configs to help users customize the build behavior.
Builder Configs are divided into the following categories:
You can find detailed descriptions of all configs on the API Reference page.
The Builder presets a default value for each config, and the default value is suitable for most scenarios. At the same time, the upper-level framework will also override some of the default values based on the requirements of the vertical scene.
In most cases, you don't need to define any Builder config, just use it right out of the box.
When you use a Builder-based upper-level framework, you can define the Builder config directly through the framework's config file, and the upper-level framework will pass the config to the Builder.
For example, in the Modern.js framework, you can define the Builder's source.alias config in modern.config.ts file.
When you call the Builder through the Node API, you can pass in the Builder config through the Provider's builderConfig
option:
Please refer to API - createBuilder for details.
Generally speaking, the Builder config is a subset of the framework config.
Builder config only deals with build-related behaviors, while framework config covers a wider range, including runtime, server, deployment, etc., so framework config is extended from Builder config.
You can enable Builder's debug mode by adding the DEBUG=builder
environment variable when executing a build.
In debug mode, Builder will write the Builder config to the dist directory, which is convenient for developers to view and debug.
Open the generated /dist/builder.config.js
file to see the complete content of the Builder config.
For a complete introduction to debug mode, see the Debug Mode chapter.