Adds static adapters

This commit is contained in:
Alicia Sykes 2024-02-10 21:33:57 +00:00
parent 12b708651d
commit cb3b87c1f3
3 changed files with 26 additions and 0 deletions

View File

@ -107,3 +107,9 @@ Notice that you might need a [Vercel account](https://docs.Vercel.com/get-starte
The project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it. The project is ready to be deployed to Vercel. However, you will need to create a git repository and push the code to it.
You can [deploy your site to Vercel](https://vercel.com/docs/concepts/deployments/overview) either via a Git provider integration or through the Vercel CLI. You can [deploy your site to Vercel](https://vercel.com/docs/concepts/deployments/overview) either via a Git provider integration or through the Vercel CLI.
## Static Site Generator (Node.js)
```shell
npm run build.server
```

View File

@ -0,0 +1,19 @@
import { staticAdapter } from "@builder.io/qwik-city/adapters/static/vite";
import { extendConfig } from "@builder.io/qwik-city/vite";
import baseConfig from "../../vite.config.mts";
export default extendConfig(baseConfig, () => {
return {
build: {
ssr: true,
rollupOptions: {
input: ["@qwik-city-plan"],
},
},
plugins: [
staticAdapter({
origin: "https://yoursite.qwik.dev",
}),
],
};
});

View File

@ -5,6 +5,7 @@
"build.client": "vite build", "build.client": "vite build",
"build.preview": "vite build --ssr src/entry.preview.tsx", "build.preview": "vite build --ssr src/entry.preview.tsx",
"build.server": "vite build -c adapters/vercel-edge/vite.config.mts", "build.server": "vite build -c adapters/vercel-edge/vite.config.mts",
"build.static": "vite build -c adapters/static/vite.config.mts",
"build.types": "tsc --incremental --noEmit", "build.types": "tsc --incremental --noEmit",
"deploy": "vercel deploy", "deploy": "vercel deploy",
"dev": "vite --mode ssr", "dev": "vite --mode ssr",