module
Lune::Assets
Defined in:
lune/assets.crConstant Summary
-
MIME_TYPES =
{".html" => "text/html; charset=utf-8", ".js" => "application/javascript", ".mjs" => "application/javascript", ".css" => "text/css", ".json" => "application/json", ".png" => "image/png", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".gif" => "image/gif", ".svg" => "image/svg+xml", ".ico" => "image/x-icon", ".woff" => "font/woff", ".woff2" => "font/woff2", ".ttf" => "font/ttf", ".eot" => "application/vnd.ms-fontobject", ".webp" => "image/webp", ".map" => "application/json"}
Class Method Summary
- .empty? : Bool
- .get(path : String) : Bytes | Nil
- .mime_for(path : String) : String
- .register(path : String, content : Bytes)
Macro Summary
-
embed_dir(dir)
Embeds all files under
dirat compile time into the binary.
Class Method Detail
Macro Detail
macro embed_dir(dir)
#
Embeds all files under dir at compile time into the binary.
Call this at the top level of your app file, not inside a method.
The path is relative to the file where the macro is called.
Lune::Assets.embed_dir("frontend/dist")
Files are registered as "/