2023-01-17 03:37:26 +01:00
|
|
|
const { defineConfig } = require("vite")
|
|
|
|
import fs from "fs"
|
|
|
|
const allHtmlFiles = fs.readdirSync(".").filter((f) => f.endsWith(".html"))
|
|
|
|
const input = {}
|
2023-01-17 18:49:15 +01:00
|
|
|
const ASSET_URL = process.env.ASSET_URL || ""
|
2023-01-17 03:37:26 +01:00
|
|
|
|
|
|
|
for (const html of allHtmlFiles) {
|
|
|
|
const name = html.substring(0, html.length - 5)
|
|
|
|
input[name] = "./" + html
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = defineConfig({
|
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
input,
|
|
|
|
},
|
|
|
|
},
|
2023-01-17 18:49:15 +01:00
|
|
|
base: `${ASSET_URL}`,
|
2023-01-17 03:44:38 +01:00
|
|
|
server: {
|
|
|
|
port: 1234,
|
|
|
|
},
|
2023-01-17 03:37:26 +01:00
|
|
|
})
|