Next.js 入門:使用 next export 輸出 static file
此篇以 Next.js 11.0.1 版為主,內容僅供參考。
若要使用 Next.js SSG 額外輸出 static HTML,不打算把 SSG 的內容置於 Next.js 的 Node.js Server 上的話,光靠目前 package.json 的 scripts 指令是不夠的,我們需要使用 next export。
修改 package.json scripts
使用 create-next-app 建立好預設 Next 專案後,到 package.json 修改 scripts,