File tree 1 file changed +18
-3
lines changed
1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -226,8 +226,9 @@ export async function logRecentCommits(pkgName: string): Promise<void> {
226
226
}
227
227
228
228
export async function updateTemplateVersions ( ) : Promise < void > {
229
- const viteVersion = ( await fs . readJSON ( '../packages/vite/package.json' ) )
230
- . version
229
+ const viteVersion = (
230
+ await fs . readJSON ( path . resolve ( __dirname , '../packages/vite/package.json' ) )
231
+ ) . version
231
232
if ( / b e t a | a l p h a | r c / . test ( viteVersion ) ) return
232
233
233
234
const dir = path . resolve ( __dirname , '../packages/create-vite' )
@@ -241,7 +242,21 @@ export async function updateTemplateVersions(): Promise<void> {
241
242
pkg . devDependencies . vite = `^` + viteVersion
242
243
if ( template . startsWith ( 'template-vue' ) ) {
243
244
pkg . devDependencies [ '@vitejs/plugin-vue' ] =
244
- `^` + ( await fs . readJSON ( '../packages/plugin-vue/package.json' ) ) . version
245
+ `^` +
246
+ (
247
+ await fs . readJSON (
248
+ path . resolve ( __dirname , '../packages/plugin-vue/package.json' )
249
+ )
250
+ ) . version
251
+ }
252
+ if ( template . startsWith ( 'template-react' ) ) {
253
+ pkg . devDependencies [ '@vitejs/plugin-react' ] =
254
+ `^` +
255
+ (
256
+ await fs . readJSON (
257
+ path . resolve ( __dirname , '../packages/plugin-react/package.json' )
258
+ )
259
+ ) . version
245
260
}
246
261
writeFileSync ( pkgPath , JSON . stringify ( pkg , null , 2 ) + '\n' )
247
262
}
You can’t perform that action at this time.
0 commit comments