feat: Update Vite config to route URL paths based on HTML file names

This commit is contained in:
Your Name (aider) committed 2025-04-28 18:06:03 +08:00
1 parent 491ecb76d5
commit 2348b25468
1 file changed
+10
+10
View File
@@ -1,10 +1,20 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import path from 'path'; import path from 'path';
import { glob } from 'glob';
import { fileURLToPath } from 'url';
export default defineConfig({ export default defineConfig({
root: './', root: './',
build: { build: {
outDir: 'dist', 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: { resolve: {
alias: { alias: {