Copy Assets
A static site typically contains many assets. An asset is a file served by a web server, which isn't a page.
Typically an asset, like an image, should be copied directly from the source set to the build set.
To copy a file from your source set to your build set, use the pick()
method on StaticShock
with a FilePicker
.
final staticShock = StaticShock()
..pick(FilePicker.parse("images/header.png"))
..pick(FilePicker.parse("scripts/highlight.js"));
To copy an entire directory, use a DirectoryPicker
.
final staticShock = StaticShock()
..pick(DirectoryPicker.parse("images"))
..pick(DirectoryPicker.parse("scripts"));
TODO: Create hooks for transforms in the asset pipeline
TODO: Write guide for how to transform assets