hyrious
hyrious
@TylerLeonhardt A little tricky to test because the remote host should also be built by yourself. If you're using the official reh build in the remote host it wouldn't work....
I can't reproduce this issue using my Windows and [your repo](https://github.com/upsolve-git/cgn-frontend) with vite. The error message seems to say the command `esbuild --version` returns an empty string. Can you test...
I cannot reproduce what you said. Maybe you can provide a runnable reproduction? Here's what I tried: [esbuild-4120.zip](https://github.com/user-attachments/files/19427274/esbuild-4120.zip)
This minimal case to trigger this error is when esbuild bundles [`@lexical/code`](https://hyrious.me/npm-browser/?q=@lexical/[email protected]/package/LexicalCode.mjs) and hits its weird dual export entry with `--minify` (which means defining `process.env.NODE_ENV="production"`): ```js // node_modules/@lexical/code/LexicalCode.mjs import *...
I believe evan would like to repeat the rollup way (transform cjs to esm completely), until he has some time to look into the rollup commonjs plugin. There are caveats...
For complex variable replacing cases, a common solution in esbuild is using the [inject](https://esbuild.github.io/api/#inject) option to provide the implementation in a real js file, [example](https://esbuild.github.io/try/#YgAwLjI1LjAALS1pbmplY3Q6ZmlsZS5qcwBlAGVudHJ5LmpzAGNvbnNvbGUubG9nKEZPTykAAGZpbGUuanMAZXhwb3J0IGNvbnN0IEZPTyA9IGBmb29g).
[Playground](https://esbuild.github.io/try/#YgAwLjI1LjEALS1idW5kbGUgLS1mb3JtYXQ9ZXNtIC0tc3BsaXR0aW5nIC0tb3V0ZGlyPS4AZQBlbnRyeS5qcwBsYXp5KCgpID0+IGltcG9ydCgnLi9saWInKSkAAGxpYi5qcwBleHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlCmV4cG9ydHMuZGVmYXVsdCA9IDQy) Although some of @paztis's word wasn't correct, the main issue regards to using splitting on a commonjs entry point (which was created by a dynamic import). esbuild only handles...
Related PR: #2067 For now, you can use a [plugin](https://github.com/hyrious/esbuild-plugin-commonjs) to just rewrite that file to replace "require(node-module)" to a toplevel static import statement.
Actually Solid.js did this [for TypeScript workaround](https://github.com/solidjs/solid/pull/1053), the `length` is not checked. I have no idea about why nodejs/readable-stream did this.
@slavafomin Have you tried [`--packages=external`](https://esbuild.github.io/api/#packages)?