Analog 是一个利用 Vite 构建应用程序和网站的 Angular 全栈元框架。
使用 analog()
插件可以在 vite.config.ts
中启用 SSR 和 SSG。
import { defineConfig } from 'vite';
import analog from '@analogjs/platform';
// https://vite.vuejs.ac.cn/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',
],
},
})],
}));
查找更多 静态网站生成器。