10

Managing Static Assets

When it comes to managing static assets, SvelteKit has little to do with the process. In fact, the entire process is handed over to the bundling tool Vite. By leveraging Vite for the management of static assets, we as developers don’t have to learn yet another framework-specific strategy. Instead, we can lean on Vite’s highly performant bundling and build processes. Because Vite automatically manages imported assets, we don’t have to worry about hashing files for caches. In this chapter, we’ll look at how we can leverage Vite to manage static assets such as images, fonts, audio, video, and CSS files. Once we examine how this is done, we’ll discuss some of the finer points surrounding static assets.

This chapter will ...

Get SvelteKit Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.