Live data from Hacker News

Esbuild 0.9

github.com

121–123 of 123 posts

Re: Esbuild 0.9

#121

Earlier quoted context omitted.

> Webpack solves a lot of edge cases well I would quibble with the word "solves". Webpack is a tool building tool. With Webpack, you can build a tool to solve your edge case problem, as long as you're willing to spend a lot of time and dig through random Github issues for your dependencies. Webpack itself however does basically nothing.

"webpack does basically nothing" https://bundlers.tooling.report/ webpack: 43.5/48 rollup: 40.5/48 parcel: 31.5/48

That website is a complete waste of time. Noting that Webpack can do something is like noting that JavaScript can do something. Yeah, sure, but unless you show me the actual code, the knowledge that JS could do it useless to me.

Let's be concrete. How do I do dynamic imports in Webpack?

> Webpack was one of the first bundlers to use Dynamic Imports as a signal for creating code-splitting boundaries.

> Unlike multiple entries, split points created using Dynamic Imports consistently result in a separate bundle being created without customizing optimization.splitChunks.

Okay, but what does that mean? How do I make it work? What are the actual configuration settings? The site gives you no clues.

All right, let's go to https://webpack.js.org/guides/code-splitting/#dynamic-import... and read the docs.

Haha, okay, yes "Webpack" can totally do dynamic imports. All you have to do is read 50 pages of confusing docs first and craft a perfect config file. If you're familiar with Webpack, it shouldn't take more than 1 or 2 hours (my serious, no joking estimate).

Or you could use a bundler tool instead of a bundler tool tool.

Re: Esbuild 0.9

#122

I switched my pet project (about 15000 lines of code) from Webpack to esbuild, and reduced the build time from 30 seconds to 2 seconds. The trickiest part was to make Tailwind CSS work. I used to do that via postcss plugin, but just running that plugin even without Webpack takes 15 seconds. Finally, with some modifications in my CSS I made it work, and purged the unused styles just by using PurgeCSS API manually. The…

Mind sharing some details? I've been working on this myself and I don't have much JS ecosystem experience. I found the same issue around using tailwindcss as a postcss plugin (it basically tripled my build time), so would love to hear alternative solutions.

Re: Esbuild 0.9

#123
post #72

ESbuild is excellent for using with TypeScript and Node.js. We were previously using Nodemon to restart the server on changes. ESbuild is fast enough that rather than having to change our workflow and run a tsc --watch process in addition to Nodemon (which would be rather a pain given that we have 5-6 microservices), we simply use ESbuild to recompile the entire service before restarting the code (it takes about 0.1…

You can instruct nodemon to run "tsc" by itself when there are file changes, so you don't have to separately run tsc in watch mode.

Yes, but tsc is super-slow if you don't use watch mode (and to be honest even if you do). The advantage of using esbuild is that it doesn't slow down the edit-test workflow.
Post reply on HN