Skip to content

Commit de7959e

Browse files
authored
chore(sfc-playground): dynamically set Vue version in downloaded project (#13074)
1 parent 021f8f3 commit de7959e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages-private/sfc-playground/src/download/download.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ export async function downloadProject(store: ReplStore) {
1717

1818
// basic structure
1919
zip.file('index.html', index)
20-
zip.file('package.json', pkg)
20+
zip.file(
21+
'package.json',
22+
pkg.replace(`"vue": "latest"`, `"vue": "${store.vueVersion || 'latest'}"`),
23+
)
2124
zip.file('vite.config.js', config)
2225
zip.file('README.md', readme)
2326

packages-private/sfc-playground/src/download/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"serve": "vite preview"
99
},
1010
"dependencies": {
11-
"vue": "^3.4.0"
11+
"vue": "latest"
1212
},
1313
"devDependencies": {
1414
"@vitejs/plugin-vue": "^5.2.2",

0 commit comments

Comments
 (0)