-
Notifications
You must be signed in to change notification settings - Fork 53
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
difficulty bundling with esbuild #57
Comments
Have a same issues |
Sounds like the solution could be as straightforward as building a CommonJS module instead of UMD for the
If there's a known use case that requires UMD, perhaps it could be exposed using the Happy to send a PR if this plan sounds good to @aeschli! 🙏 |
The With webpack you need to add
I'm not fluent with esbuild but think you might have to configure a similar thing. The Monaco editor used UMD that's why we have it. We might no longer do so. Before removing the support, I'd like to double-check. |
We recently prioritized `module` over `main` but this results in browser code being prioritized sometimes. We revert that change and keep the original/default ESBuild main field order. This unveils an issue with `jsonc-parser` though- which ships an UMD file for `main` that cannot be bundled. We can work around this by processing `jsonc-parser`'s ESM output directly and then using that instead of leaving resolution to ESBuild for this package. There is an issue for this being tracked: microsoft/node-jsonc-parser#57
We recently prioritized `module` over `main` but this results in browser code being prioritized sometimes. We revert that change and keep the original/default ESBuild main field order. This unveils an issue with `jsonc-parser` though- which ships an UMD file for `main` that cannot be bundled. We can work around this by processing `jsonc-parser`'s ESM output directly and then using that instead of leaving resolution to ESBuild for this package. There is an issue for this being tracked: microsoft/node-jsonc-parser#57
We recently prioritized `module` over `main` but this results in browser code being prioritized sometimes. We revert that change and keep the original/default ESBuild main field order. This unveils an issue with `jsonc-parser` though- which ships an UMD file for `main` that cannot be bundled. We can work around this by processing `jsonc-parser`'s ESM output directly and then using that instead of leaving resolution to ESBuild for this package. There is an issue for this being tracked: microsoft/node-jsonc-parser#57
We recently prioritized `module` over `main` but this results in browser code being prioritized sometimes. We revert that change and keep the original/default ESBuild main field order. This unveils an issue with `jsonc-parser` though- which ships an UMD file for `main` that cannot be bundled. We can work around this by processing `jsonc-parser`'s ESM output directly and then using that instead of leaving resolution to ESBuild for this package. There is an issue for this being tracked: microsoft/node-jsonc-parser#57
for anybody find solution ref: https://github.com/tjx666/awesome-vscode-extension-boilerplate/blob/main/scripts/esbuild.mts#L28, I find solution from https://github.com/vuejs/language-tools/blob/master/packages/vscode-vue/scripts/build.js |
Hey @aeschli, would you accept a PR where https://github.com/developit/microbundle will be added to support umd,cjs and esm for this package? |
I also fixed it with putting |
I accidentally pushed a crash out to a bunch of people last night due to this; it's totally my fault for not testing the bundle itself (testing is separate), but this is a very real problem. Hoping for #78. |
I want to use node-jsonc-parser in a vscode extension and, per the guidance, I am using esbuild as the bundler. Unfortunately it doesn't work 'out of the box'; the internally required files (in
src/impl/
) are not bundled. I filed evanw/esbuild#1619 with esbuild. They explained the reason and suggested a work around, but also mentioned 'making the code (ie. node-jsonc-parser) more bundler friendly'.I'd appreciate any advice on whether this is possible/straightforward to do, thanks in advance.
The text was updated successfully, but these errors were encountered: