vite-plugin-html-template
vite-plugin-html-template copied to clipboard
Usage with Vite version 5
I've been using vite-plugin-html-template to build multi page app with vite-plugin-mpa on Vite version 4.
Recently updated to Vite version 5 and found that it needs to set appType: 'mpa'
on vite config to load a bundle file for each page.
Without the config pageName
is not correctly found and falls back to index
, which leads to every page loading a bundle file of index page.
Here req.url
is .src/pages/test
with Vite version 4. But with Vite version 5, it is /test
without appType: 'mpa'
.
https://github.com/IndexXuan/vite-plugin-html-template/blob/0a4b2d8528833ce282c6817cc65a4af79b773f83/src/index.ts#L56-L62