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 be divided into the following sections:
- Importing Assets
- Additional Information
By the time we’re done, we’ll have a firm grasp of the best practices to use when including files...