antfu / vscode-vite

One step faster for Vite in VS Code ⚡️
https://marketplace.visualstudio.com/items?itemName=antfu.vite
451 stars 25 forks source link

Can't figure out how to create project #20

Closed masonbesmer closed 2 years ago

masonbesmer commented 2 years ago

How do you create a project (folder) with this plugin and use the run button to launch the webserver (like in the gif on the main readme.md)? I have searched for quite a long time now and have not found a quickstart for this VScode plugin. Thank you

antfu commented 2 years ago

This plugin is only for launching the web view instead of creating a project. Using npm init vite or start from my template https://github.com/antfu/vitesse

masonbesmer commented 2 years ago

How do you run it without npm run dev? The “vite” button in the bottom right doesn’t show up and the server doesn’t automatically start on launch

antfu commented 2 years ago

It checks the existence of vite in package.json of project root

masonbesmer commented 2 years ago

It checks the existence of vite in package.json of project root

I'm not sure it works, or maybe I'm doing something wrong. When launching VS code with a folder with package.json of the following:

{ "name": "workshop-fixed", "version": "0.0.0", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" }, "devDependencies": { "vite": "^2.7.2" }, "dependencies": { "three": "^0.137.5" } } it does not start the server, and this is what the bottom right of my ide looks like. image There is no "Vite" button to see. Am I missing something? Sorry if it's blatantly obvious.

masonbesmer commented 2 years ago

Your template works, however, npm init vite does not work in setting up the folder correctly