@@ -17,6 +17,7 @@ export interface CMKConfig {
1717 arbitraryExtensions : boolean ;
1818 namedExports : boolean ;
1919 prioritizeNamedImports : boolean ;
20+ keyframes : boolean ;
2021 /**
2122 * A root directory to resolve relative path entries in the config file to.
2223 * This is an absolute path.
@@ -72,6 +73,7 @@ interface UnnormalizedRawConfig {
7273 arbitraryExtensions ?: boolean ;
7374 namedExports ?: boolean ;
7475 prioritizeNamedImports ?: boolean ;
76+ keyframes ?: boolean ;
7577}
7678
7779/**
@@ -138,6 +140,16 @@ function parseRawData(raw: unknown, tsConfigSourceFile: ts.TsConfigSourceFile):
138140 } ) ;
139141 }
140142 }
143+ if ( 'keyframes' in raw . cmkOptions ) {
144+ if ( typeof raw . cmkOptions . keyframes === 'boolean' ) {
145+ result . config . keyframes = raw . cmkOptions . keyframes ;
146+ } else {
147+ result . diagnostics . push ( {
148+ category : 'error' ,
149+ text : `\`keyframes\` in ${ tsConfigSourceFile . fileName } must be a boolean.` ,
150+ } ) ;
151+ }
152+ }
141153 if ( 'namedExports' in raw . cmkOptions ) {
142154 if ( typeof raw . cmkOptions . namedExports === 'boolean' ) {
143155 result . config . namedExports = raw . cmkOptions . namedExports ;
@@ -247,14 +259,15 @@ export function readConfigFile(project: string): CMKConfig {
247259 const { configFileName, config, compilerOptions, diagnostics } = readTsConfigFile ( project ) ;
248260 const basePath = dirname ( configFileName ) ;
249261 return {
250- // If `include` is not specified, fallback to the default include spec.
262+ // If `include` is not specified, fallback to the default include spec。
251263 // ref: https://github.com/microsoft/TypeScript/blob/caf1aee269d1660b4d2a8b555c2d602c97cb28d7/src/compiler/commandLineParser.ts#L3102
252264 includes : ( config . includes ?? [ DEFAULT_INCLUDE_SPEC ] ) . map ( ( i ) => join ( basePath , i ) ) ,
253265 excludes : ( config . excludes ?? [ ] ) . map ( ( e ) => join ( basePath , e ) ) ,
254266 dtsOutDir : join ( basePath , config . dtsOutDir ?? 'generated' ) ,
255267 arbitraryExtensions : config . arbitraryExtensions ?? false ,
256268 namedExports : config . namedExports ?? false ,
257269 prioritizeNamedImports : config . prioritizeNamedImports ?? false ,
270+ keyframes : config . keyframes ?? true ,
258271 basePath,
259272 configFileName,
260273 compilerOptions,
0 commit comments