boiler plating

This commit is contained in:
2025-03-02 17:04:04 -05:00
parent d499e013f5
commit d26a88628b
6 changed files with 82 additions and 61 deletions

View File

@ -1,9 +1,27 @@
import { defineConfig } from 'vite'
import { createHtmlPlugin } from 'vite-plugin-html'
import { ViteEjsPlugin } from 'vite-plugin-ejs'
import fs from "fs"
import path from "path"
const html_dir = path.join(__dirname, "src", "html")
function inlineHtml(html_file_name) {
try {
const html_path = path.resolve(path.join(html_dir, html_file_name+".html"))
return fs.readFileSync(html_path, "utf-8")
} catch(read_err) {
return "[INLINE-ERROR], "+read_err
}
}
export default defineConfig({
plugins: [
createHtmlPlugin({minify: true}),
ViteEjsPlugin({
inlineHtml: inlineHtml
})
],
root: "src",
build: {