Deprecated options
This page lists configuration options that have been deprecated in Rspack.
These options are kept for backward compatibility only and should not be used in new projects.
experiments.topLevelAwait
- Type:
boolean - Default:
true
Enables support for Top-level await. Top-level await can only be used in modules with ModuleType set to javascript/esm.
Enabled by default. Can be disabled with this configuration:
This option has been deprecated and will be removed in Rspack v2.0.
Top-level await will always be enabled in the future. Remove this option from your Rspack configuration.
experiments.lazyCompilation
Used to enable lazy compilation.
This configuration has been deprecated. Use lazyCompilation instead.
experiments.layers
- Type:
boolean - Default:
true
Controls whether to enable the layer feature. Layers add an identifier prefix to all modules in a subgraph starting from a module in the module graph, to distinguish them from modules in different layers. For example:
The layer of the index.js module is null by default, and its identifier is ./index.js. If we set layer = 'client' for it, its identifier becomes (client)/./index.js. At this point, the index.js modules in these two different layers are treated as distinct modules, because their unique identifiers differ. The final output includes the artifacts of both modules.
By default, a module's layer is null, and it inherits its parent module's layer. You can add a layer to an entry module using entryOptions.layer, and add a layer to matched modules using module.rule[].layer. Additionally, you can match based on the parent module's layer using module.rule[].issuerLayer.
This option is deprecated. Layers are now always enabled. Remove this option from your Rspack configuration.
experiments.parallelCodeSplitting
- Type:
boolean - Default:
false
Enabling this configuration will activate a new multi-threaded code splitting algorithm. If your project includes many dynamic imports and doesn't have cyclic chunks, this can greatly reduce the time spent on the code splitting process.
This option is deprecated, it has a huge performance regression in some edge cases where the chunk graph has lots of cycles. We'll improve the performance of build_chunk_graph in the future instead.
When parallelCodeSplitting is enabled, ensure that 'optimization.removeAvailableModules' is also enabled (this has been enabled by default since version 1.3.0).
This maintains consistency with the previous code splitting algorithm, which enforced removeAvailableModules internally and ignored the optimization.removeAvailableModules configuration.
rules[].loaders
An array to pass the loader package name and its options.
This option has been deprecated. Use rules[].use instead.
experiments.inlineConst
- Type:
boolean - Default:
false
Used to enable the experimental feature for cross-module inline optimization for constant exports.
This configuration has been deprecated and is no longer required. The inline exports optimization is now controlled by optimization.inlineExports instead.
experiments.inlineEnum
- Type:
boolean - Default:
false
Used to enable inline optimization for TypeScript enums.
This configuration has been deprecated and is no longer required. Inline enum optimization is now controlled by optimization.inlineExports and builtin:swc-loader rspackExperiments.collectTypeScriptInfo.exportedEnum.
Please refer to inline enum example for more details.
experiments.lazyBarrel
- Type:
boolean - Default:
true
Used to enable lazy barrel optimization for skipping the building of unused re-export modules in side-effect-free barrel files.
This configuration has been deprecated and will be removed in Rspack v2.0. Lazy barrel optimization is already stable and enabled by default. Remove this option from your Rspack configuration.
Lazy barrel is now a stable feature that is always enabled. It helps optimize build performance by skipping the building of unused re-export modules in side-effect-free barrel files.
For more details, see the Lazy barrel guide.
experiments.typeReexportsPresence
- Type:
boolean - Default:
false
Used to enable error tolerance for type re-exports.
This configuration has been deprecated and is no longer required. Type re-exports presence checking is now controlled by module.parser.javascript.typeReexportsPresence and builtin:swc-loader rspackExperiments.collectTypeScriptInfo.typeExports.
Please refer to type reexports presence example for more details.
module.parser.javascript.inlineConst
- Type:
boolean - Default:
false
Used to control whether to perform cross-module inline optimization for constant exports in the parser.
This configuration has been deprecated. Use optimization.inlineExports instead.

