From f82cfb6a5a9419bbd5f49f20a9af95d50db406c5 Mon Sep 17 00:00:00 2001 From: Ryan Turnquist Date: Thu, 4 Apr 2024 14:31:47 -0700 Subject: [PATCH] chore: update readme --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f26f21..19a5a9c 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,12 @@ export default defineConfig({ }); ``` +# Base paths + +When deploying an application under a nested public path, use Vite's [`base` option](https://vitejs.dev/config/shared-options.html#base) to specify a path to prefix all assets. This option can also be specified with the `BASE_URL` environment variable. + +If the base path is not static, see the [basePathVar](#optionsbasepathvar) option for handling more advanced cases. + # Browser asset references With @marko/vite when a _static relative path_ is used for certain native tag attributes, the relative asset will be imported and processed by Vite. @@ -62,7 +68,7 @@ As an example, with the following template, the `logo.svg` will be imported and ``` -You can see the list of elements and their attributes which are processed [here](./src/relative-assets-transform.ts). +Most common image, media, and font filetypes are transformed automatically but some file types such as `.js` and `.css` files will not be. Generally these should be imported directly and not rendered as markup. To force the transformation of a path, add `?url` to it. You can see the list of elements and their attributes which are processed [here](./src/relative-assets-transform.ts). # Linked Mode