This repository was archived by the owner on Jun 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 22
33import { execSync , spawn } from 'node:child_process'
44import { resolve } from 'node:path'
5- import { readFileSync , writeFileSync } from 'node:fs'
5+ import { readFileSync , writeFileSync , existsSync } from 'node:fs'
66
77const NPM = 'npm'
88
@@ -107,5 +107,18 @@ viteProcess.on('close', (code) => {
107107 )
108108 writeFileSync ( packageJSONPath , modifiedPackageJSON , 'utf8' )
109109
110+ // So TypeScript doesn't complain about about String#startsWith in the vite.config.ts
111+ if ( existsSync ( resolve ( cwd , 'tsconfig.node.json' ) ) ) {
112+ process . stdout . write ( '\nPatching tsconfig.node.json\n' )
113+
114+ const tsconfigNodeJSONPath = resolve ( cwd , 'tsconfig.node.json' )
115+ const tsconfigNodeJSON = readFileSync ( tsconfigNodeJSONPath , 'utf-8' )
116+ const modifiedTsconfigNodeJSON = tsconfigNodeJSON . replace (
117+ '"compilerOptions": {' ,
118+ '"compilerOptions": {\n "lib": ["ESNext"],'
119+ )
120+ writeFileSync ( tsconfigNodeJSONPath , modifiedTsconfigNodeJSON , 'utf8' )
121+ }
122+
110123 process . stdout . write ( `\nDone!\n\nBuild and run your app with:\nssc build -r ${ projectName } ` )
111124} )
You can’t perform that action at this time.
0 commit comments