-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite: Update sandbox template for vue2 script #20750
Vite: Update sandbox template for vue2 script #20750
Conversation
// preferring community bootstrap scripts / generators instead. | ||
script: | ||
'yarn create vite . --template vanilla && yarn add --dev @vitejs/plugin-vue2 vue-template-compiler vue@2 && echo "import vue2 from \'@vitejs/plugin-vue2\';\n\nexport default {\n\tplugins: [vue2()]\n};" > vite.config.js', | ||
script: 'npx create-vue@2 {{beforeDir}} --default', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://github.com/vuejs/create-vue, it looks like we could also use npm create vue@3
, right? Especially since SB7 does not support IE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's unclear to me based on that readme whether that's the version of the creator or the version of vue that will be installed. It only mentions IE support as the difference between the two. I think that to create a vue3 project, npm create vite
is used instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IanVS with create-vue@3 it does generate a Vue3 Vite project:
{
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.2.45"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.0.0",
"vite": "^4.0.0"
}
}
The docs states:
Or, if you need to support IE11, you can create a Vue 2 project with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, thank you so much for your contribution @fazulk ! This way we'll be testing projects much closer to the real use cases.
…se-official-vue2/vite-script
@yannbf Do i need to re-commit with |
@fazulk we'll need to change that flag once this is merged and https://github.com/storybookjs/sandboxes is updated based on the change you're making. It's a very clunky, round-about way of generating sandbox templates, and hopefully we can clean it up sometime. |
…script-to-use-official-vue2/vite-script
\o/ We're green! |
Issue: #20748
What I did
Update the Vue2/Vite loading script to use the official vue package.
How to test
yarn task --task dev --start-from=install --template vue2-vite/2.7-js
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]