You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make this repo the single canonical reference for a Node.js + Vite + multipage (MPA) app architecture, by migrating the best patterns from the sibling Vite repos into it and then retiring them.
This repo is the keeper because it has the most traction (20★, 8 forks) and already demonstrates true multipage — multiple HTML entry points at nested paths (index.html, foo/index.html, foo/bar/index.html). What it lacks is the Node.js tier and modern Vite config. We pull those in here.
Rename: this repo will be renamed from vite-multipage to vite-vue-mpa (the clearer name). GitHub preserves stars/forks on rename and redirects the old URL. The name is currently held by the repo we're retiring, so it gets freed first (see Retirement plan).
What to pull in (and from where)
Each item below is a decision, not an open question — migrate all of it.
From vite-vue-mpa (the Node + glob-MPA architecture)
Express server that mounts the UI as middleware — server/index.js: server.use(uiServer), one Node server serves every page. This is the missing Node tier.
Glob-based MPA entry discovery — replace the hand-maintained entryPoints("index.html", "foo/index.html", …) list in the current vite.config.js with globbySync("pages/**/*.html") → rollupOptions.input. Adding a page becomes "add an HTML file," no config edit.
appType: "mpa" in the Vite config.
Workspace monorepo split — common (isomorphic utils: html.js, http.js, module.js, file.js, listen()), server (Node), ui (Vite). Adopt the workspaces: ["common", "server", "ui"] layout.
htmlIncludes() Vite plugin and the listen() helper from common.
From vite-vue3-express-starter (the API tier)
Separate API middleware tier — mount an api/ workspace alongside the UI: server.use(uiMiddleware()); server.use(apiMiddleware()). Document the full stack (static pages + JSON API) in one server.
Do NOT carry its crufty deps — leave behind ramda, @repeaterjs/repeater, caller, hot-esm, 2-thenable. Migrate the pattern, not the dependency bloat.
Keep from this repo (vite-multipage)
The nested multipage pages — port them into the new ui/pages/ layout so the glob discovery has real nested entries to prove the MPA claim.
Sass support — preserve the style/style.scss setup.
~ alias to project root.
Gaps to fix here
No Node server today — start just runs http-server dist. Replace with the Express server above.
Vite 2 (beta) → upgrade to current Vite. Bump vite, @vitejs/plugin-vue, vue to current majors.
No workspaces — restructure into the common/server/ui monorepo.
README — rewrite to document the consolidated architecture (see below).
README must explain the three load-bearing mechanisms:
MPA entry discovery — globbySync("pages/**/*.html") → rollupOptions.input; add a page = add an HTML file.
Node + Vite integration — Express imports the ui (and api) package as middleware; one server serves all pages and the API.
Workspace split — common (isomorphic), server (Node), api (Node), ui (Vite).
Retirement plan (after migration verified)
Retire vite-vue-mpa once its server/glob-config/workspace patterns are confirmed working here. This also frees the vite-vue-mpa name.
Rename this repovite-multipage → vite-vue-mpa once the name is freed. (Do this after the retirement above; GitHub keeps stars/forks and redirects the old URL.)
Retire vite-vue3-express-starter once its API-tier pattern is ported.
Add a redirect note in both retired repos' READMEs pointing here as the canonical reference.
Leave vite-plugin-no-fallback untouched — it's a separate library, not an app.
Goal
Make this repo the single canonical reference for a Node.js + Vite + multipage (MPA) app architecture, by migrating the best patterns from the sibling Vite repos into it and then retiring them.
This repo is the keeper because it has the most traction (20★, 8 forks) and already demonstrates true multipage — multiple HTML entry points at nested paths (
index.html,foo/index.html,foo/bar/index.html). What it lacks is the Node.js tier and modern Vite config. We pull those in here.Rename: this repo will be renamed from
vite-multipagetovite-vue-mpa(the clearer name). GitHub preserves stars/forks on rename and redirects the old URL. The name is currently held by the repo we're retiring, so it gets freed first (see Retirement plan).What to pull in (and from where)
Each item below is a decision, not an open question — migrate all of it.
From
vite-vue-mpa(the Node + glob-MPA architecture)server/index.js:server.use(uiServer), one Node server serves every page. This is the missing Node tier.entryPoints("index.html", "foo/index.html", …)list in the currentvite.config.jswithglobbySync("pages/**/*.html")→rollupOptions.input. Adding a page becomes "add an HTML file," no config edit.appType: "mpa"in the Vite config.common(isomorphic utils:html.js,http.js,module.js,file.js,listen()),server(Node),ui(Vite). Adopt theworkspaces: ["common", "server", "ui"]layout.htmlIncludes()Vite plugin and thelisten()helper fromcommon.From
vite-vue3-express-starter(the API tier)api/workspace alongside the UI:server.use(uiMiddleware()); server.use(apiMiddleware()). Document the full stack (static pages + JSON API) in one server.ramda,@repeaterjs/repeater,caller,hot-esm,2-thenable. Migrate the pattern, not the dependency bloat.Keep from this repo (
vite-multipage)ui/pages/layout so the glob discovery has real nested entries to prove the MPA claim.style/style.scsssetup.~alias to project root.Gaps to fix here
startjust runshttp-server dist. Replace with the Express server above.vite,@vitejs/plugin-vue,vueto current majors.common/server/uimonorepo.Target architecture (end state)
README must explain the three load-bearing mechanisms:
globbySync("pages/**/*.html")→rollupOptions.input; add a page = add an HTML file.ui(andapi) package as middleware; one server serves all pages and the API.common(isomorphic),server(Node),api(Node),ui(Vite).Retirement plan (after migration verified)
vite-vue-mpaonce its server/glob-config/workspace patterns are confirmed working here. This also frees thevite-vue-mpaname.vite-multipage→vite-vue-mpaonce the name is freed. (Do this after the retirement above; GitHub keeps stars/forks and redirects the old URL.)vite-vue3-express-starteronce its API-tier pattern is ported.vite-plugin-no-fallbackuntouched — it's a separate library, not an app.