我有一个基于https://github.com/developit/nextjs-preact-demo
的简单网络应用但是,预渲染不起作用:/namegenerator
路由包含起始页中的HTML。比较:
当我使用yarn build
/ yarn start
在本地构建时,它会正确地预呈现。
Vercel.com构建日志:
09:23:48.828 Page Size First Load JS
09:23:48.828 ┌ ○ / 10.4 kB 41.1 kB
09:23:48.828 ├ /_app 0 B 23 kB
09:23:48.828 ├ ○ /404 2.26 kB 25.2 kB
09:23:48.828 ├ ○ /namegenerator 6.55 kB 37.3 kB
09:23:48.828 ├ λ /robots.txt 1.37 kB 24.3 kB
09:23:48.828 └ ○ /sitemap.xml 1.44 kB 24.4 kB
09:23:48.828 + First Load JS shared by all 23 kB
09:23:48.828 ├ chunks/d40dc564045013f46fe7b769c9db622bd3eb9de7.c8692d.module.js 6.1 kB
09:23:48.828 ├ chunks/framework.83b4b8.module.js 8.12 kB
09:23:48.828 ├ chunks/main.2fb80a.module.js 6.37 kB
09:23:48.828 ├ chunks/pages/_app.e85fd9.module.js 1.64 kB
09:23:48.828 └ chunks/webpack.07c5bc.module.js 751 B
09:23:48.828 λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
09:23:48.828 ○ (Static) automatically rendered as static HTML (uses no initial props)
09:23:48.828 ● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
09:23:48.828 (ISR) incremental static regeneration (uses revalidate in getStaticProps)
(在preact-cli应用中,这将由prerenderUrls.json
处理)