Skip to content

Commit

Permalink
fix: update type CSSModulesOptions interface (#14987)
Browse files Browse the repository at this point in the history
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
  • Loading branch information
psychobolt and bluwy authored Nov 17, 2023
1 parent d9ae680 commit d0b2153
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/config/shared-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>,
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)
}
```

Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export interface CSSModulesOptions {
) => void
scopeBehaviour?: 'global' | 'local'
globalModulePaths?: RegExp[]
exportGlobals?: boolean
generateScopedName?:
| string
| ((name: string, filename: string, css: string) => string)
Expand Down

0 comments on commit d0b2153

Please sign in to comment.