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

chore: Update vite config of build cjs output #4

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

rxliuli
Copy link
Contributor

@rxliuli rxliuli commented Nov 21, 2023

ref: microsoft/vscode#130367 (comment)

before:
image

after:
image

@Malix-off
Copy link
Owner

Malix-off commented Nov 21, 2023

Holy fuck @rxliuli thanks a lot!
Also, shouldn't I specify something in the https://github.com/Malix-off/VSC-Extension-StashFlow/blob/dev/tsconfig.json too?
I noticed the "moduleResolution": "bundler" option constraints me to use "module": "es2015" // or later
image

@rxliuli
Copy link
Contributor Author

rxliuli commented Nov 21, 2023

Holy fuck @rxliuli thanks a lot! Also, shouldn't I specify something in the https://github.com/Malix-off/VSC-Extension-StashFlow/blob/dev/tsconfig.json too? I noticed the "moduleResolution": "bundler" option constraints me to use "module": "es2015" // or later image

tsconfig.json only affects the development phase, specifically vscode code prompts, the build is completely taken over by vite, and ts compilation uses esbuild instead of tsc.

@Malix-off
Copy link
Owner

@rxliuli

tsconfig.json only affects the development phase, specifically vscode code prompts, the build is completely taken over by vite, and ts compilation uses esbuild instead of tsc.

Oh okay, thanks for that clarification!
It would have been very much easier if vite could infer those parameters through tsconfig rather than having two different boilerplate 😄

Do you know if it would be better to keep my https://github.com/Malix-off/VSC-Extension-StashFlow/blob/dev/tsconfig.json with "module": "ESNext" to make it compliant with "moduleResolution": "bundler", or should I edit it to make "module": "CommonJS" and change "moduleResolution": "bundler" to something else?

@rxliuli
Copy link
Contributor Author

rxliuli commented Nov 21, 2023

Just a personal opinion, "module": "ESNext" is always best as writing code always expects esm not cjs.

@Malix-off
Copy link
Owner

@rxliuli

Just a personal opinion, "module": "ESNext" is always best as writing code always expects esm not cjs.

Okay, thanks for your insights and your help, I really do appreciate ❤️

@Malix-off Malix-off merged commit abd166a into Malix-off:dev Nov 21, 2023
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 this pull request may close these issues.

None yet

2 participants