From 2348b254681a035aef51031423719c7b3b7a7fa3 Mon Sep 17 00:00:00 2001 From: "Your Name (aider)" Date: Mon, 28 Apr 2025 18:06:03 +0800 Subject: [PATCH] feat: Update Vite config to route URL paths based on HTML file names --- vite.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vite.config.js b/vite.config.js index 26a6c9e..7a6ef85 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,10 +1,20 @@ import { defineConfig } from 'vite'; import path from 'path'; +import { glob } from 'glob'; +import { fileURLToPath } from 'url'; export default defineConfig({ root: './', build: { outDir: 'dist', + rollupOptions: { + input: Object.fromEntries( + glob.sync('*.html').map(file => [ + path.basename(file, path.extname(file)), + fileURLToPath(new URL(file, import.meta.url)) + ]) + ) + } }, resolve: { alias: {