# Build and serve frontend assets

Source: https://zotonic.com/docs/1637/build-and-serve-frontend-assets

URI: https://zotonic.com/id/1637

Language: en

Keep source files such as SCSS in priv/lib-src and compiled assets in priv/lib. Use an app-level Makefile that delegates asset work to the source directory's Makefile.

Keep source files such as SCSS in `priv/lib-src` and compiled assets in `priv/lib`. Use an app-level Makefile that delegates asset work to the source directory's Makefile.

Use <a href="/id/1372" class="doc-reference doc-reference-tag"><code>tag#lib</code></a> to include library files using Zotonic's asset handling. Follow the existing base template's placement of styles and scripts so dependencies load in the expected order.

After changing a source file, check the asset build output and the browser's network response. If the source changed but the served file did not, inspect the build step before flushing caches. Use [Reload the browser after source changes](/id/2971) during development and [A saved change does not appear](/id/3000) when changes remain invisible.

For a first stylesheet, create `priv/lib/css/garden.css` with a visible rule for a class in your page, then include it through `{% lib "css/garden.css" %}` in the site's head block. Check the loaded response in the browser. A plain CSS file needs no SCSS compiler; when you introduce generated CSS, document the exact Makefile target beside its source.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1637?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1637?language=en>)
