34 lines
784 B
TypeScript
34 lines
784 B
TypeScript
import { resolve } from "path";
|
|
import { defineConfig } from "vite";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
// Custom plugin to load markdown files
|
|
{
|
|
name: "markdown-loader",
|
|
transform(code, id) {
|
|
if (id.slice(-3) === ".md") {
|
|
// For .md files, get the raw content
|
|
return `export default ${JSON.stringify(code)};`;
|
|
}
|
|
},
|
|
},
|
|
{
|
|
name: "html-loader",
|
|
transform(code, id) {
|
|
if (id.slice(-5) === ".html") {
|
|
// For .md files, get the raw content
|
|
return `export default ${JSON.stringify(code)};`;
|
|
}
|
|
},
|
|
},
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(__dirname, "index.html"),
|
|
},
|
|
},
|
|
},
|
|
});
|