What is Snowpack?

How to use Snowpack with Svelte and React

Ferenc Almasi
Webtips

--

What is Snowpack?

Snowpack is a build tool similar to Webpack. It aims to bring lightning-fast build times with its unbundled development approach. It does this by only building each module once, and never again. Whereas Webpack and other bundlers usually bundle your whole application each time something changes in your application. This can mean several seconds for larger projects that can add up really fast.

Bundled vs unbundled approach
Illustration on how Snowpack is different from other bundlers. Image is taken from the official docs of Snowpack

Snowpack only rebuilds a file if it actually changes, whereas Webpack rebuilds your whole bundle. This means that for each module, you will get a different file, unlike in Webpack where it bundles all dependencies into one single JavaScript file. From this point of view, Snowpack is a great fit for any size of project. As your project grows, your build times won’t. They stay as fast as they are at the start of your project.

It’s also worth mentioning that Snowpack caches your builds to avoid building the same file over and over again. On top of that, it offers no configuration, just like Parcel. If you still need to define some custom rules, Snowpack does have a configuration file you can use to customize it to your own taste.

--

--

Ferenc Almasi
Webtips

💻 Frontend dev • ✍️ Creator of webtips.dev • 🐦 Tweets at @WebtipsHQ