From 41974cefad8b23d85f4d6e8ba3156c628d1b159d Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sat, 21 Mar 2026 19:56:37 +0000 Subject: inlines .gmi --- src/vitePlugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vitePlugin.ts') diff --git a/src/vitePlugin.ts b/src/vitePlugin.ts index 1568b14..7b5ef44 100644 --- a/src/vitePlugin.ts +++ b/src/vitePlugin.ts @@ -2,7 +2,7 @@ import {HTMLRenderer, parse} from "gemtext" import path from "path" import {pathToFileURL} from "url" import type {Plugin} from "vite" -import {ext, type GemtextConfig} from "./index.js" +import {type GemtextConfig} from "./index.js" function transform(code: string, id: string, config: GemtextConfig) { const result = parse(code) @@ -54,7 +54,7 @@ export default function gemtextVitePlugin(config: GemtextConfig): Plugin { name: "astro-gemtext", enforce: "pre", transform(code, id) { - if (!id.endsWith(`.${ext}`)) return + if (!id.endsWith('.gmi')) return return { code: transform(code, id, config), map: null, -- cgit v1.2.3