File tree Expand file tree Collapse file tree 2 files changed +590
-355
lines changed Expand file tree Collapse file tree 2 files changed +590
-355
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ export const tanstackViteConfig = (options) => {
53
53
filePath,
54
54
content : ensureImportFileExtension ( { content, extension : 'js' } ) ,
55
55
} ) ,
56
+ afterDiagnostic : ( diagnostics ) => {
57
+ if ( diagnostics . length > 0 ) {
58
+ console . error ( 'Please fix the above type errors' )
59
+ process . exit ( 1 )
60
+ }
61
+ } ,
56
62
} ) ,
57
63
dts ( {
58
64
outDir : `${ outDir } /cjs` ,
@@ -64,11 +70,15 @@ export const tanstackViteConfig = (options) => {
64
70
module : 1 , // CommonJS
65
71
declarationMap : false ,
66
72
} ,
67
- beforeWriteFile : ( filePath , content ) => {
68
- content = ensureImportFileExtension ( { content, extension : 'cjs' } )
69
- filePath = filePath . replace ( '.d.ts' , '.d.cts' )
70
-
71
- return { filePath, content }
73
+ beforeWriteFile : ( filePath , content ) => ( {
74
+ filePath : filePath . replace ( '.d.ts' , '.d.cts' ) ,
75
+ content : ensureImportFileExtension ( { content, extension : 'cjs' } ) ,
76
+ } ) ,
77
+ afterDiagnostic : ( diagnostics ) => {
78
+ if ( diagnostics . length > 0 ) {
79
+ console . error ( 'Please fix the above type errors' )
80
+ process . exit ( 1 )
81
+ }
72
82
} ,
73
83
} ) ,
74
84
] ,
You can’t perform that action at this time.
0 commit comments