Happy release day! We are excited to announce Snowpack v2.7 with a handful of new features improving stability and the overall developer experience:
- Redesigned plugin API plus new guides for plugin authors
- Import aliasing and new ways to customize Snowpack
- Improved build performance with smaller, faster builds
- New Svelte + TypeScript app templates
- Bug fixes, usability improvements & more!
Plus, we hit some VERY exciting project milestones last month:
- ❤️ 150open source contributors (and growing!)
- 🏆 1000+ discussions, issues, and pull requests
- ⭐️ 10,000+ stars on GitHub
- 👋 New companies using Snowpack:Alibaba & Airhacks
If you’ve been waiting for an excuse to give Snowpack a try, now is a great time to start! Try out a Create Snowpack App (CSA) template or install Snowpack into any existing project:
# install with npm npm install --save-dev snowpack # install with yarn yarn add --dev snowpack
Redesigned Plugin API
Snowpack v2.7 features an major rewrite of our internal build pipeline to support a more reliable and expressive plugin API. New optimizations and file type builders are unlocked with the redesigned
optimize() plugin hooks (with more on the way in future versions).
Snowpack 2.7 is fully backwards compatible with older plugins, so you can upgrade Snowpack without worrying about version mismatches.
Every hook is documented in our new Plugins Guide for plugin authors. The new API is heavily inspired by Rollup, so we hope it already feels familiar to many of you.
Snowpack v2.0 originally introduced the concept of build
"scripts" as a way to configure anything from file building to HTTP request proxying. Scripts were flexible, but hard to document and frustrating to debug.
Our internal plugin rewrite presented an opportunity to improve the developer experience while keeping the flexibility of direct CLI tooling. You can now connect third-party tooling directly into Snowpack’s build pipeline using one of two new utility plugins:
@snowpack/plugin-build-script: Use any CLI directly to build files for Snowpack.
@snowpack/plugin-run-script: Run arbitrary CLI commands during dev/build.
Other options like
alias (see below) are now easier to customize as well with top-level config options that take the guesswork out of common configuration.
"scripts" configuration format will continue to be supported in Snowpack v2, but we recommend migrating any custom scripts to
"plugins" and plan to remove support in a future major release.
New: Import Aliasing
In previous versions of Snowpack, import aliasing was hard to understand and configure (and it didn’t support all types of aliasing). Starting in Snowpack v2.7, Import Aliases gets a new top-level
alias config so that you can define as many custom aliases as you’d like. Package import aliases are also supported.
Improved Build Performance
Snowpack’s official webpack plugin is now more powerful than ever, with new support for multi-page website bundling and better default performance settings (based on the latest research from Google). Special shout out to @mxmul (Yelp) for leading these community contributions!
If you don’t use a bundler in production, you’ll still see a smaller build. That’s because Snowpack v2.7 now ships with minification on by default. We plan to keep improving the default unbundled build performance story over the next few releases, so stay tuned.
Svelte + TypeScript Support
Last week, Svelte announced official support for TypeScript. We’re huge fans of both projects and couldn’t pass up the chance to test the new support out in a brand new Svelte + TypeScript app template for Snowpack.
Visit Create Snowpack App for a list of all of our new app templates.
Thank You, Contributors!
Finally, Snowpack wouldn’t be possible without the 150+ contributors who contributed features, fixes, and documentation improvements. Thanks again for all of your help.
— Snowpack Maintainers