site: render markdown file as string
This commit is contained in:
committed by
Johannes Kirschbauer
parent
25db58ce11
commit
70523f75fa
@@ -1,6 +1,16 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import { sveltekit } from "@sveltejs/kit/vite";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()]
|
||||
plugins: [
|
||||
sveltekit(),
|
||||
{
|
||||
name: "markdown-loader",
|
||||
transform(code, id) {
|
||||
if (id.slice(-3) === ".md") {
|
||||
return `export default ${JSON.stringify(code)};`;
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user