@charmland/gem-vite 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/html.d.ts +5 -0
- package/dist/index.js +838 -176
- package/dist/og.d.ts +32 -1
- package/dist/output.d.ts +41 -5
- package/dist/paths.d.ts +1 -0
- package/dist/preview.d.ts +8 -0
- package/dist/theme.d.ts +6 -0
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -26,3 +26,7 @@ export default defineConfig({
|
|
|
26
26
|
Add `content/index.md`, then run `vite dev` or `vite build`. The package's public entrypoint is `@charmland/gem-vite`, which exports the `gem` plugin and `GemOptions`.
|
|
27
27
|
|
|
28
28
|
The default setup uses Gem's prebuilt theme and does not need the Elm compiler. Install and use Elm only when customizing and recompiling Gem's Elm sources. See the [Gem documentation](https://github.com/charmbracelet/gem#readme) for customization details.
|
|
29
|
+
|
|
30
|
+
## Build performance
|
|
31
|
+
|
|
32
|
+
`generateBundle` runs sequentially: it renders and emits the OG covers first, then prerenders every page in source order and writes its `.md` and HTML. Prerendering boots the real Elm theme in jsdom, which is CPU-bound, and the build prints one `[gem] build timings` line separating covers, prerendering, the 404 page and the total. Covers use Takumi's native renderer (`@takumi-rs/core`), loaded lazily and drawing each PNG in a single native pass with no headless browser or separate SVG rasterization step.
|
package/dist/html.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Page, SiteDocument } from "@charmland/gem-compiler/types";
|
|
2
|
+
import type { ImageSize } from "./output.js";
|
|
2
3
|
export interface DocumentHtmlOptions {
|
|
3
4
|
site: SiteDocument;
|
|
4
5
|
page: Page | null;
|
|
@@ -8,6 +9,10 @@ export interface DocumentHtmlOptions {
|
|
|
8
9
|
client?: boolean;
|
|
9
10
|
origin?: string | null;
|
|
10
11
|
ogImage?: boolean;
|
|
12
|
+
/** Sniffed dimensions of a static `[site] og_image`, when local. */
|
|
13
|
+
staticImageSize?: ImageSize | null;
|
|
14
|
+
/** The deployment mount path (`"/"` or `"/sub/"`); prefixes head URLs. */
|
|
15
|
+
basePath?: string;
|
|
11
16
|
}
|
|
12
17
|
export declare function routeFile(route: string): string;
|
|
13
18
|
export declare function documentHtml(options: DocumentHtmlOptions): string;
|