-
Notifications
You must be signed in to change notification settings - Fork 16
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
🤦VS Code extensions do not support esm #114
Comments
Yep, that's a serious disappointment. |
Not sure how would that help for a dependency that is not used in webview but in the extension itself 🤔. Do you have any example I could check 👍? |
Yep, I use vite to bundle my VSCode extension |
Awesome. I need to check it for sure 🤩. Will it work also if one of the dependencies I use is already build in esm? As this is actually the problem I'm having |
Yes, it's the main point of bundler, fixing the dumbass cjs vs esm fight and optimize code output with minification and circular resolution, and library imports with tree-shaking |
this is awesome. I need to do a deep dive on this in the coming weekend. |
You're welcome ❤️ |
@Malix-off, it is a great tip, also started using Vite a while ago, but now stepping away from it again as Vite dropped CJS support in v5 and will be completely removed in v6.
I stumbled on this issue as I had some issues with types that were incorrectly referenced during the build and made the extension fail. It would be better to look at |
Nope, they dropped their own CJS Node API, which is a good thing imho because it would be kind of a non-sense to use a bundler in a non-ESM environment anyway (actually I'm a bit surprised they released a CJS Node API in the first place) It means that to use Vite, you would need to use their ESM API (thus, to develop in ESM rather than CJS (I personally very much recommend that no matter what)), but vite will still be available to output CJS See https://github.com/Malix-off/VSC-Extension-StashFlow/blob/master/vite.config.ts as an exemple Edit
|
related issues and PRs |
🎯 Aim
The aim of this issue is to track the support of es modules in VS Code extensions.
Issues with more info:
Currently using CLI for Microsoft 365 directly from PnP builds is not possible due to that, so for now as a temporary workaround the CLI dependency is added from a local version of the package which was reverted to common js
https://github.com/Adam-it/cli-microsoft365/tree/cli-cjs
The text was updated successfully, but these errors were encountered: