File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ async function build() {
9191 } )
9292
9393 console . log ( 'π Generating and bundling TypeScript declarations...' )
94+ let dtsBundlingFailed = false
9495 try {
9596 const [ bundle ] = generateDtsBundle (
9697 [
@@ -110,7 +111,8 @@ async function build() {
110111 await fixDuplicateImports ( )
111112 console . log ( ' β Created bundled type definitions' )
112113 } catch ( error ) {
113- console . warn ( 'β TypeScript declaration bundling failed:' , error . message )
114+ dtsBundlingFailed = true
115+ console . error ( 'β TypeScript declaration bundling failed:' , error . message )
114116 }
115117
116118 console . log ( 'π Copying WASM files for tree-sitter...' )
@@ -123,6 +125,10 @@ async function build() {
123125 console . log ( ' π dist/index.mjs (ESM)' )
124126 console . log ( ' π dist/index.cjs (CJS)' )
125127 console . log ( ' π dist/index.d.ts (Types)' )
128+
129+ if ( dtsBundlingFailed ) {
130+ throw new Error ( 'TypeScript declaration bundling failed' )
131+ }
126132}
127133
128134/**
@@ -203,5 +209,8 @@ async function copyRipgrepVendor() {
203209}
204210
205211if ( import . meta. main ) {
206- build ( ) . catch ( console . error )
212+ build ( ) . catch ( ( error ) => {
213+ console . error ( error )
214+ process . exit ( 1 )
215+ } )
207216}
You canβt perform that action at this time.
0 commit comments