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

native esm loader with jiti.import #32

Closed
Tracked by #174
pi0 opened this issue May 27, 2021 · 4 comments · Fixed by #259
Closed
Tracked by #174

native esm loader with jiti.import #32

pi0 opened this issue May 27, 2021 · 4 comments · Fixed by #259

Comments

@pi0
Copy link
Member

pi0 commented May 27, 2021

In contexts where file extension is explicit .mjs or closest package.json has type: module we may use native ESM and for typescript, disable CommonJS transforms.

Blocker is, jiti is supposed to be used in a cjs context (require replacement). We probably need to implement a new function like jiti.import that returns Promise (compatible to be dynamic import replacement)

@dioxine
Copy link

dioxine commented Jun 5, 2021

oh yeah, waiting this so much, cause vite-plugin-windicss uses jiti for loading configurations and thats why it cannot work with type: module sveltekit exclusively uses.

@danielroe danielroe self-assigned this Jun 10, 2022
@pi0
Copy link
Member Author

pi0 commented Jun 17, 2022

@danielroe I've moved vite 3 related issue to #66. Supporting native esm loader (jiti.import) can probably wait until Node.js has it out of the flag.

@pi0 pi0 changed the title native esm native esm with jiti.import Jun 17, 2022
@pi0 pi0 changed the title native esm with jiti.import native esm loader with jiti.import Jun 17, 2022
@dohooo
Copy link

dohooo commented Jun 18, 2022

Hi, Thanks for your effort! This project is very useful! 🥳

Uhhh, How to disable CommonJS transforms? Any workarounds are there?

@pi0
Copy link
Member Author

pi0 commented May 3, 2023

Hi. Just a quick update, i still plan to do this. In the meantime, are they are incomaptbile libraries with cjs transforms? Please mention them there might be faster fixes for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants