Analog 是一個全端元框架,用於使用 Angular 和 Vite 建置應用程式和網站。
可以使用 analog()
外掛在 vite.config.ts
中啟用 SSR 和 SSG。
import { defineConfig } from 'vite';
import analog from '@analogjs/platform';
// https://vite.dev.org.tw/config/
export default defineConfig(({ mode }) => ({
plugins: [analog({
ssr: true, // enables server side rendering
static: true, // enables static site generation
prerender: { // configure routes to be rendered at build time
routes: async () => [
'/',
'/about',
'/blog',
'/blog/posts/2023-02-01-my-first-post',
],
},
})],
}));
尋找更多靜態網站產生器。