output

output.externals output.externalsoutput.externals

Prevent some import dependencies from being packed into bundles in your code, and instead Rstest will import them at runtime.

  • In the Node.js test environment, all packages in node_modules are externalized by default.
  • In the browser-like (jsdom, etc) test environment, all packages are bundled by default.

If you want a dependency to be externalized, you can configure it in output.externals.

rstest.config.ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  output: {
    externals: ['react'],
  },
});

output.cssModules output.cssModulesoutput.cssModules

For custom CSS Modules configuration.

output.cleanDistPath output.cleanDistPathoutput.cleanDistPath

Whether to clean up all test temporary files under the output directory before the test starts.

By default, rstest does not write test temporary files to disk, and this configuration item may be required when you debug rstest outputs.