Home > @lynx-js/rspeedy > Output > cssModules

Output.cssModules property

The CssModules option is used for the customization of CSS Modules configurations.

Signature:

cssModules?: CssModules | undefined;

Remarks

The CSS module is enabled for *.module.css, *.module.scss and *.module.less. Use CssModules.auto to customize the filtering behavior.

Example 1

Disable CSS modules:

import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  output: {
    cssModules: {
      auto: false,
    },
  },
})

Example 2

Enable CSS modules for all CSS files:

import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  output: {
    cssModules: {
      auto: () => true,
    },
  },
})
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.