File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,8 +226,9 @@ export async function logRecentCommits(pkgName: string): Promise<void> {
226226}
227227
228228export 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
231232 if ( / b e t a | a l p h a | r c / . test ( viteVersion ) ) return
232233
233234 const dir = path . resolve ( __dirname , '../packages/create-vite' )
@@ -241,7 +242,21 @@ export async function updateTemplateVersions(): Promise<void> {
241242 pkg . devDependencies . vite = `^` + viteVersion
242243 if ( template . startsWith ( 'template-vue' ) ) {
243244 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
245260 }
246261 writeFileSync ( pkgPath , JSON . stringify ( pkg , null , 2 ) + '\n' )
247262 }
You can’t perform that action at this time.
0 commit comments