Skip to content
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 can support deno runtime? #109

Closed
Hoverhuang-er opened this issue May 10, 2020 · 10 comments
Closed

Vite can support deno runtime? #109

Hoverhuang-er opened this issue May 10, 2020 · 10 comments

Comments

@Hoverhuang-er
Copy link

Vite already write on Typescript. But it still need running with npm. How to Setup running vite with deno?

Thx

@yyx990803
Copy link
Member

Deno has a completely different runtime semantics and none of the npm dependencies that Vite relies on. It's also too early stage at this time.

@hronro
Copy link
Contributor

hronro commented May 14, 2020

@yyx990803
But it's also a great chance to make Deno more popular if popular JS libraries like Vue/Vite could support Deno (or at least be compatible with Deno). One of the biggest pain I found in the Node.js ecosystem is that there are too many NPM packages depends on commonjs and use require('...') dynamically, therefore those packages can't work well with bundlers like Rollup (and now Vite either).
Since Vite is a brand new project and there is no historical baggage for Vite, Why not embrace a brand new ecosystem without the commonjs issues and more friendly for TypeScript? I think it could be meaningful for both Vite and Deno.

@cztomsik
Copy link

It actually works already (you just need to do little change locally)
#714

@benatkin
Copy link

@cztomsik I think that's an entirely different use of deno and vite together than what this issue is about. Both are valuable. I am pretty sure this issue is about running a vite server with Deno. Yours is about importing the output of the Vite server into Deno. I think maybe your particular issue should be fixed by Deno rather than Vite. If you can't convince them because their idea of zero-config means importing something without an extension will always assume it's TypeScript, well that's too bad for the Deno project.

@benatkin
Copy link

@cztomsik not all is lost if Deno won't make that change, though - I think a vite plugin might be able to make it work, and if not, perhaps a separate PR that would make the plugin system powerful enough to allow this would get merged in.

@cztomsik
Copy link

@benatkin correct, I found this issue and posted here not reading too much if it's server or client.

  • server-side might work in future when used with this)
  • client-side works already even without the change (I am using it occasionally)

@elycheikhsmail
Copy link

vite distingue two thing deps and src code
vite transform node to esm module in node/.vite directory this step not needed in deno ecosys because we all or most npm pkg transformed to esm in skypack.dev (for exemple ) and we don't to do it in our local machine but scr bundle on the fly is usefull for deno-frontend if is possibke

@benatkin
Copy link

I think perhaps that generating code to be run by Deno is just as outside of scope for Vite as getting it to run on Deno. It probably would be useful for Deno to have something like Vite to bundle modules, but it isn't aligned with the goals of Vite.

I'm interested in both Vite and Deno, and I think it would be interesting if a new project were built for Deno that is similar to Vite. Since it would have its own goals, the developers could design it to build code to run on Deno in addition to browsers.

@klarkc
Copy link

klarkc commented Jun 28, 2021

@benatkin I don't know if it's similar somehow to Vite (because I'm still testing it) but there is this alternative: https://github.com/open-source-labs/vno

@github-actions
Copy link

This issue gets locked because it has been closed for more than 14 days.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants