← Files Website Deploy ToolkitARCHIVED FILE
skills/website-deploy/references/frameworks.md
2.52 KB · Oct 5, 2026 · 18:33 UTC
# Detect a framework and build it for path hosting Detect from `package.json` (dependencies and `scripts`) plus root config files. Run the framework's **production** build with a **relative** base/public path, then upload the output directory. A site is served at the root of its own host, where root-absolute `/assets/...` works too; version previews and a brand-new account's first minutes (`<handle>.simple-host.app/<sitename>/`) serve it under a path, where only relative `./assets/...` works. Nothing runs at serve time — only static files are served. | Framework | Detect | Build (with relative base) | Output | |---|---|---|---| | Vite (Vue/React/Svelte/Preact/Lit) | `vite` dep or `vite.config.*` | `npx vite build --base ./` (or `base:'./'` in config) | `dist/` | | Next.js | `next` dep or `next.config.*` | in `next.config`: `output:'export'`, `images.unoptimized:true`, `trailingSlash:true`, `assetPrefix:'./'` → `npx next build` | `out/` | | Create React App | `react-scripts` dep | `PUBLIC_URL=. npm run build` (macOS/Linux/bash); PowerShell: `$env:PUBLIC_URL='.'; npm run build`; cmd.exe: `set PUBLIC_URL=.&& npm run build` | `build/` | | SvelteKit | `@sveltejs/kit` dep or `svelte.config.*` | `@sveltejs/adapter-static` with `fallback:'index.html'` + `kit.paths.relative:true` → `npm run build` | `build/` | | Astro | `astro` dep or `astro.config.*` | `base:'./'` in `astro.config` → `npx astro build` | `dist/` | | Nuxt 3/4 | `nuxt` dep or `nuxt.config.*` | relative `app.baseURL` → `npx nuxt generate` (NOT `nuxt build` — that's a Node server) | `.output/public/` | | Angular | `@angular/core` dep or `angular.json` | `ng build --configuration=production --base-href ./` | `dist/<proj>/` (or `dist/<proj>/browser/` on v17+) | | Gatsby | `gatsby` dep or `gatsby-config.*` | relative `pathPrefix`/asset prefix → `npx gatsby build` | `public/` | | Vue CLI (legacy, no Vite) | `@vue/cli-service` or `vue.config.js` | `publicPath:'./'` in `vue.config.js` → `npm run build` | `dist/` | | Plain static (no build) | no `package.json` / no framework dep | none — upload as-is, **relative links only** | the dir itself | **Unrecognized build system** (Eleventy, Hugo, Jekyll, Remix static export, Qwik, SolidStart, VitePress, Docusaurus, …): run its normal production build with a relative base/public path and upload the output directory. The rule does not change — root-absolute asset URLs break in previews and a new site's first minutes. Never string-rewrite a built bundle to repair its base path. Rebuild with the framework's own configuration.
SHA-256: 79e992f115df5d9634b2c2b0d3e8cd078ba89d19b0d3162b02cc45f222abeb0b