feat: Update Vite config to route URL paths based on HTML file names
This commit is contained in:
1 parent
491ecb76d5
commit
2348b25468
1 file changed
+10
@@ -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: {
|
||||||
|
|||||||
Reference in new issue
Block a user