diff --git a/docs/config/shared-options.md b/docs/config/shared-options.md index 4c74725c308521..e6ac34f36e2ef5 100644 --- a/docs/config/shared-options.md +++ b/docs/config/shared-options.md @@ -168,21 +168,31 @@ Enabling this setting causes vite to determine file identity by the original fil - **Type:** ```ts interface CSSModulesOptions { + getJSON?: ( + cssFileName: string, + json: Record, + outputFileName: string, + ) => void scopeBehaviour?: 'global' | 'local' globalModulePaths?: RegExp[] + exportGlobals?: boolean generateScopedName?: | string | ((name: string, filename: string, css: string) => string) hashPrefix?: string /** - * default: null + * default: undefined */ localsConvention?: | 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' - | null + | (( + originalClassName: string, + generatedClassName: string, + inputFile: string, + ) => string) } ``` diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 2f91ea93bacac0..2333a721df8d4f 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -115,6 +115,7 @@ export interface CSSModulesOptions { ) => void scopeBehaviour?: 'global' | 'local' globalModulePaths?: RegExp[] + exportGlobals?: boolean generateScopedName?: | string | ((name: string, filename: string, css: string) => string)