Interface: Config
The Config is the configuration that rspeedy uses.
Properties
dev?
optionaldev?:Dev
The Dev option is used to control the behavior related with development. Including: HMR, DevServer, etc.
Default Value
environments?
optionalenvironments?:Record<string,EnvironmentConfig>
Lynx Default Changed
The Config.environments option is used to set the output environment.
Default Value
When this option is unset, Rspeedy passes { lynx: {} } to Rsbuild.
Remarks
Normally you don't need this if you are not using Lynx for Web.
Examples
- Using different entries for Lynx and Web.
- Building Web-only outputs.
mode?
optionalmode?:"production"|"development"|"none"
Specify the build mode for Rsbuild and Rspack, as each mode has different default behavior and optimizations.
Default Value
Depends on process.env.NODE_ENV:
'production'whenNODE_ENVis'production''development'whenNODE_ENVis'development''none'otherwise
With Rspeedy's CLI, rspeedy dev and rspeedy preview default to 'development', and rspeedy build defaults to 'production'.
Examples
output?
optionaloutput?:Output
The Output option is used to set how and where should the bundles and assets output.
Default Value
performance?
optionalperformance?:Performance
The Performance option is used to optimize the build-time and runtime performance.
Default Value
plugins?
optionalplugins?:RsbuildPlugins
The plugins option is used to customize the build process in a variety of ways.
Default Value
Remarks
Rspeedy uses the plugin APIs from Rsbuild. See the corresponding document for developing a plugin.
resolve?
optionalresolve?:Resolve
The Resolve option is used to control the resolution behavior of Rspack.
Default Value
server?
optionalserver?:Server
The Server option changes the behavior of dev-server.
Default Value
source?
optionalsource?:Source
The Source option changes the behavior of source files.
Default Value
splitChunks?
optionalsplitChunks?:false|SplitChunksConfig
Configure chunk splitting.
Default Value
Rspeedy defaults this to false; if configured, Rsbuild handles it with its top-level splitChunks option.
Remarks
See Rsbuild - splitChunks for details.
tools?
optionaltools?:Tools
The Tools options changes the behavior of various building tools.