Skip to content

Commit d0b2153

Browse files
psychoboltbluwy
andauthoredNov 17, 2023
fix: update type CSSModulesOptions interface (#14987)
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
1 parent d9ae680 commit d0b2153

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
 

Diff for: ‎docs/config/shared-options.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,31 @@ Enabling this setting causes vite to determine file identity by the original fil
168168
- **Type:**
169169
```ts
170170
interface CSSModulesOptions {
171+
getJSON?: (
172+
cssFileName: string,
173+
json: Record<string, string>,
174+
outputFileName: string,
175+
) => void
171176
scopeBehaviour?: 'global' | 'local'
172177
globalModulePaths?: RegExp[]
178+
exportGlobals?: boolean
173179
generateScopedName?:
174180
| string
175181
| ((name: string, filename: string, css: string) => string)
176182
hashPrefix?: string
177183
/**
178-
* default: null
184+
* default: undefined
179185
*/
180186
localsConvention?:
181187
| 'camelCase'
182188
| 'camelCaseOnly'
183189
| 'dashes'
184190
| 'dashesOnly'
185-
| null
191+
| ((
192+
originalClassName: string,
193+
generatedClassName: string,
194+
inputFile: string,
195+
) => string)
186196
}
187197
```
188198

Diff for: ‎packages/vite/src/node/plugins/css.ts

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export interface CSSModulesOptions {
115115
) => void
116116
scopeBehaviour?: 'global' | 'local'
117117
globalModulePaths?: RegExp[]
118+
exportGlobals?: boolean
118119
generateScopedName?:
119120
| string
120121
| ((name: string, filename: string, css: string) => string)

0 commit comments

Comments
 (0)
Please sign in to comment.