Other Options

These are the remaining configuration options supported by rspack.

bail

  • Type: boolean
  • Default: false

Fail out on the first error instead of tolerating it. By default Rspack will log these errors in red in the terminal, as well as the browser console when using HMR, but continue bundling. To enable it:

rspack.config.js
module.exports = {
  bail: true,
};

This will force Rspack to exit its bundling process.

dependencies

  • Type: string[]
  • Default: undefined

A list of name defining all sibling configurations it depends on. Dependent configurations need to be compiled first.

In watch mode dependencies will invalidate the compiler when:

  1. the dependency has changed
  2. a dependency is currently compiling or invalid

Remember that current configuration will not compile until its dependencies are done.

rspack.config.js
module.exports = [
  {
    name: 'client',
    target: 'web',
    // …
  },
  {
    name: 'server',
    target: 'node',
    dependencies: ['client'],
  },
];

ignoreWarnings

  • Type: (RegExp | ((warning: Error, Compilation: Compilation) => boolean))[]
  • Default: undefined

Tells Rspack to ignore specific warnings.

rspack.config.js
module.exports = {
  //...
  ignoreWarnings: [/warning from compiler/, warning => true],
};

name

  • Type: string
  • Default: undefined

Name of the configuration. Used when loading multiple configurations.

rspack.config.js
module.exports = {
  //...
  name: 'admin-app',
};