vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
67.97k stars 6.12k forks source link

Electron Apps With Vite #12288

Closed ghost closed 1 year ago

ghost commented 1 year ago

Description

Please include functinallity in vite , so that when creating new project after entering name of project are prompted to ask frame work, electron appears there and after choosing electron which framework we need touse appears like... react, vue, angular vanila etc. after that option comes where we want to use typescript or javascript etc.

Suggested solution

npm create vite@latest

Project Name >> New Electron App

Select Framework >> Electron

Select Web Framework >> React, Vue etc.

Select a variant >> Javacript, Typescript etc.

Select styling >> CSS, SASS, SCSS etc.

Done. Now run:

cd "electron app" npm install npm run dev

Alternative

there's template at github which does this

Vite+Electron+React+SASS (Github)

Additional context

No response

Validations

fi3ework commented 1 year ago

As the document says

create-vite is a tool to quickly start a project from a basic template for popular frameworks. Check out Awesome Vite for community maintained templates that include other tools or target different frameworks. You can use a tool like degit to scaffold your project with one of the templates.

IMO it's not likely to add an Electron template without an official plugin support.

bluwy commented 1 year ago

Yes, for now Electron support in Vite is community-based only, but we're happy to support it in create-vite with it's "Others" option here, which can point to https://github.com/electron-vite/create-electron-vite. Feel free to add that in a PR if you'd like.

github-actions[bot] commented 1 year ago

Hello @akt-01. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!

ghost commented 1 year ago

Ummm.. I am still learning stuff so its kind of not possible for me to contirbute cause i have used vite only watching yt tutorials maybe me or somebody in future could help.

caoxiemeihao commented 1 year ago

@bluwy Hey! 👋

I have good news for you, Electron is officially working with electron-vite, Electron's official scaffolding Forge will support Vite in the next version v6.1.0. https://github.com/electron/forge/pull/3071

electron-vite will continue to work on the integration of Electron with Vite :)

caoxiemeihao commented 1 year ago

Yes, for now Electron support in Vite is community-based only, but we're happy to support it in create-vite with it's "Others" option here, which can point to https://github.com/electron-vite/create-electron-vite. Feel free to add that in a PR if you'd like.

This seems like a really good idea, maybe I'll submit a PR for it. cc @fi3ework

bluwy commented 1 year ago

Nice! Didn't know that it would be supported in Forge soon. Happy to have create-vite re-route to the CLI. I think ideally having it point to a Vite template by default would be great.

DerTimonius commented 1 year ago

Is this still available? I'd love to take a shot at this 🙂

caoxiemeihao commented 1 year ago

Is this still available? I'd love to take a shot at this 🙂

Coming soon.

DerTimonius commented 1 year ago

Coming soon.

Sorry if I caused some misunderstanding, I meant that I would like to contribute

caoxiemeihao commented 1 year ago

Sorry if I caused some misunderstanding, I meant that I would like to contribute

Thanks, but for now we still need to make some changes in create-electron-vite to adapt to create-vite.