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

Ability to import builtin Node.js modules #2172

Closed
danyadev opened this issue Feb 22, 2021 · 2 comments
Closed

Ability to import builtin Node.js modules #2172

danyadev opened this issue Feb 22, 2021 · 2 comments
Labels
has workaround wontfix This will not be worked on

Comments

@danyadev
Copy link

Is your feature request related to a problem? Please describe.
It is impossible to develop an Electron application normally, because vite does not allow using import for builtin Node.js modules.

Describe the solution you'd like
Option in vite config

Describe alternatives you've considered
.

Additional context
This is what happens when you use import dns from 'dns':

image

@yyx990803
Copy link
Member

This is explicitly a non-goal. However if you install your own Node.js built-in shims Vite can resolve to them.

@xiaoxiangmoe
Copy link
Contributor

@danyadev try https://github.com/xiaoxiangmoe/vite-plugin-commonjs-externals

@Shinigami92 Shinigami92 added has workaround wontfix This will not be worked on labels Mar 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has workaround wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants