Skip to content

Commit

Permalink
refactor(css): hide internal preprocessor types and expose types used…
Browse files Browse the repository at this point in the history
… for options (#18458)
  • Loading branch information
sapphi-red authored Oct 25, 2024
1 parent c148676 commit c32837c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"./types/*": {
"types": "./types/*"
},
"./types/internal/*": null,
"./package.json": "./package.json"
},
"typesVersions": {
Expand Down
3 changes: 3 additions & 0 deletions packages/vite/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ export type {
CSSModulesOptions,
PreprocessCSSResult,
ResolvedCSSOptions,
SassPreprocessorOptions,
LessPreprocessorOptions,
StylusPreprocessorOptions,
} from './plugins/css'
export type { JsonOptions } from './plugins/json'
export type { TransformOptions as EsbuildTransformOptions } from 'esbuild'
Expand Down
8 changes: 4 additions & 4 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import type {
SassLegacyPreprocessBaseOptions,
SassModernPreprocessBaseOptions,
StylusPreprocessorBaseOptions,
} from 'types/cssPreprocessorOptions'
} from 'types/internal/cssPreprocessorOptions'
import { getCodeWithSourcemap, injectSourcesContent } from '../server/sourcemap'
import type { EnvironmentModuleNode } from '../server/moduleGraph'
import {
Expand Down Expand Up @@ -1976,18 +1976,18 @@ type PreprocessorAdditionalData =
| PreprocessorAdditionalDataResult
| Promise<PreprocessorAdditionalDataResult>)

type SassPreprocessorOptions = {
export type SassPreprocessorOptions = {
additionalData?: PreprocessorAdditionalData
} & (
| ({ api: 'legacy' } & SassLegacyPreprocessBaseOptions)
| ({ api?: 'modern' | 'modern-compiler' } & SassModernPreprocessBaseOptions)
)

type LessPreprocessorOptions = {
export type LessPreprocessorOptions = {
additionalData?: PreprocessorAdditionalData
} & LessPreprocessorBaseOptions

type StylusPreprocessorOptions = {
export type StylusPreprocessorOptions = {
additionalData?: PreprocessorAdditionalData
} & StylusPreprocessorBaseOptions

Expand Down

0 comments on commit c32837c

Please sign in to comment.