3 ms·
They weren't using SWC? They describe deploying to Vercel, and Next.js has had stable built-in support for SWC for a good while now
by brundolf 3y ago
They weren't using SWC? They describe deploying to Vercel, and Next.js has had stable built-in support for SWC for a good while now
- byhemechi 3y agoiirc next.js only uses swc for the dev mode bundler edit: this is no longer the case, ignore me :)
- re-thc 3y agoWebpack is the bundler. SWC as used in Next.js doesn't do the bundling part.
- icemelt8 3y agoI also didn't understand this, if they were using NextJS, why do they have a custom webpack config? My assumption is that there is a separate web app that does the drawing and coloring, they bundle it into a script.js and include it in their nextJS page.
- shaneos 3y agoYes, this is correct. All the canvas stuff has nothing to do with React, so I bundle it all separately. In fact, I don't even load React on the browser, I just render the initial page with it on the server then just work with the DOM from there on out. It greatly reduces the amount of JS shipped to the client, and since 90% of my code was going to be Canvas related, it's not much overhead to add a few click listeners for various DOM nodes
- brundolf 3y agoAh true, my bad. Though it's still relevant to mention, because usually when people hear "using Webpack" they also assume "using Babel". Bun is doing both the bundling and the transpiling, so it should be compared to the bundler + transpiler combination