Environment context is a read-only object that provides some context information about the current environment.
In Rsbuild's hooks, you can get the environment context object through the environment
or environments
parameter.
The unique name of the current environment is used to distinguish and locate the environment, corresponds to the key in the environments configuration.
string
The range of target browsers that the project is compatible with. See details in Browserslist.
string[]
The Rsbuild environment configuration after normalization.
The absolute path of the output directory, corresponding to the output.distPath.root config in RsbuildConfig
.
string
The entry object from the source.entry option.
The path information for all HTML assets.
This API will return an object, the key is the entry name and the value is the relative path of the HTML file in the dist directory.
The absolute path of the tsconfig.json file, or undefined
if the tsconfig.json file does not exist in current project.