Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can't decide if the root cause of this problem is in esbuild or in Vue. The fact you can't do "import vue from 'Vue';" with esbuild means either it's module resolver is terrible, or Vue is doing something super-weird with the way it bundles artifacts. Either way, something is seriously wrong.

FWIW, "import react from 'React';" works fine with esbuild with no config, so I'm inclined to think this is a problem in Vue.



> The fact you can't do "import vue from 'Vue';" with esbuild

You misunderstood, they say this is exactly how it works. But they wanted a specific build instead of the default one of vue (the one with the runtime compiler, not default because it has performance penalties).


It could be argued the default was wrong (when originally chosen).

If you don't have the runtime compiler, then that means either you: 1. handwrote the the compiled templates, which is rather unlikely, or 2. you are using additional tooling to precompile.

If you are using additional tooling to precompile then that tooling ought to handle aliasing to the runtime only version, (or if not using a cli style tool, the instructions for setting up the bundler to use a loader should include setting up the alias).

However it is probably too late to fix things, since existing projects will assume the default is the compiler-less runtime, and would perform worse if things were changed, since existing projects would not have the new alias to run-time only version in place.


That doesn't seem like a good comparison because what was missing in her case was the Vue equivalent of the JSX compile phase.


esbuild works with jsx out of the box. Most of the examples in the docs are jsx.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: