Hacker News new | past | comments | ask | show | jobs | submit login

Exactly: 99% of the time, "webpack is slow" is just code for "I have Babel in my toolchain" and forgetting to set ts-loader as "transpile only".

Personally I removed it years ago, and Webpack 5 even allowed me to get rid of more loaders now that there are Assets Modules that automatically detect assets and webworkers using the "new URL()" syntax, and Typescript does everything else I need.




The new URL() thing is amazing


Can someone clarify what the new URL() thing is?




I can remove babel in my code?


It depends on your target platform: ES6 modules are basically supported in every browser I care about, so the major reason for Babel is JSX


Even if your target platform didn't have ES6 modules, Babel is probably not the tool you'd want to transpile those with. Let the bundler (which is the topic of the discussion here so I assume a bundler is used) handle them. Tree shaking works better that way anyway.

Also if JSX or similar JS extensions are the only thing you need tramspiling for, you might want to look at Sucrase [1] as a fast alternative to Babel.

https://github.com/alangpierce/sucrase




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

Search: