Chapter 13
Assets
The Javascript files, CSS files, image files, fonts, and other resources used to create the client-side experience of your web application are collectively known as assets. When dealing with assets on the server, our application needs to address some problems:
- How do we locate a Sprinkle's assets, generate an appropriate URL, and inject the appropriate reference tags when rendering a template?
- When the client actually loads a page and requests an asset via the URL, how do we map the URL back to a file path on the server and return it to the client?
- How do we handle compiled assets, aka bundle of assets bundle together to improve efficiency?
- How do we integrate with modern frameworks, like Vue.JS, or preprocessors like Sass?
- How to we load external NPM dependencies?
These questions are answered in this chapter.