让我们讨论 Jamstack 的未来 — 加入我们

Analog

1586 星标
128 分叉
43 问题
主页
https://analogjs.org/
代码库
analogjs/analog
Twitter
@analogjs
语言
TypeScript
许可证
MIT
模板
Angular

Analog 是一个利用 Vite 构建应用程序和网站的 Angular 全栈元框架。

功能

  • 混合 SSR/SSG 支持
  • 基于文件的路由
  • 支持使用 Markdown 作为内容路线
  • 支持 API/服务器路由

配置

使用 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',
      ],
    },
  })],
}));

查找更多 静态网站生成器