4 ms·
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 r
by wildpeaks 5y ago
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.
- fiddlerwoaroof 5y agoThe new URL() thing is amazing
- netghost 5y agoCan someone clarify what the new URL() thing is?
- __s 5y agohttps://webpack.js.org/guides/asset-modules https://webpack.js.org/guides/asset-modules
- fiddlerwoaroof 5y agothis is the release notes for it: https://webpack.js.org/blog/2020-10-10-webpack-5-release/#asset-modules https://webpack.js.org/blog/2020-10-10-webpack-5-release/#as...
- joshxyz 5y agoI can remove babel in my code?
- fiddlerwoaroof 5y agoIt depends on your target platform: ES6 modules are basically supported in every browser I care about, so the major reason for Babel is JSX
- inbx0 5y agoEven 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 https://github.com/alangpierce/sucrase