Static Site Adapter
Qwik's Static Site adapter helps to generate static html files which can be easily deployed to any cloud providers.
Installation
To integrate the ssg
adapter, use the add
command:
pnpm run qwik add ssg
npm run qwik add ssg
yarn run qwik add ssg
bun run qwik add ssg
Above command will create a directory at project root named adapters/ssg/vite.config.mts
with the below code.
adapters/ssg/vite.config.mts
import { ssgAdapter } from "@qwik.dev/router/adapters/ssg/vite";
import { extendConfig } from '@qwik.dev/router';
import baseConfig from '../../vite.config.mts';
export default extendConfig(baseConfig, () => {
return {
build: {
ssr: true,
rollupOptions: {
input: ['@qwik-router-config'],
},
},
plugins: [
ssgAdapter({
origin: 'https://yoursite.qwik.dev',
}),
],
};
});
Remember to change the
origin
in this file to your domain.
Now, you can generate static site while using Qwik
's rich ecosystem, file based routing and many more.