timlrx / tailwind-nextjs-starter-blog

This is a Next.js, Tailwind CSS blogging starter template. Comes out of the box configured with the latest technologies to make technical writing a breeze. Easily configurable and customizable. Perfect as a replacement to existing Jekyll and Hugo individual blogs.
https://tailwind-nextjs-starter-blog.vercel.app/
MIT License
8.76k stars 2.04k forks source link

为什么我运行npm run build后,并未生成静态网站的根目录-out目录? #1043

Open briteming opened 1 day ago

briteming commented 1 day ago

hi.

12799@DESKTOP-B6LK9IO MINGW64 ~/tailwind-nextjs-starter-blog (main) $ npm run build

tailwind-nextjs-starter-blog@2.2.0 build cross-env INIT_CWD=$PWD next build && cross-env NODE_OPTIONS='--experimental-json-modules' node ./scripts/postbuild.mjs

▲ Next.js 14.2.16

Creating an optimized production build ... Warning: Contentlayer might not work as expected on Windows successCallback C:/Users/12799/tailwind-nextjs-starter-blog/.contentlayer (node:73244) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use node --trace-warnings ... to show where the warning was created) Local search index generated... Generated 13 documents in .contentlayer ✓ Compiled successfully Linting and checking validity of types ... ⚠ TypeScript project references are not fully supported. Attempting to build in incremental mode. ✓ Linting and checking validity of types ✓ Collecting page data ✓ Generating static pages (42/42) ✓ Collecting build traces ✓ Finalizing page optimization

Route (app) Size First Load JS ┌ ○ / 1.13 kB 95.2 kB ├ ○ /_not-found 138 B 87.4 kB ├ ○ /about 295 B 92.6 kB ├ ƒ /api/newsletter 0 B 0 B ├ ○ /blog 139 B 101 kB ├ ● /blog/[...slug] 6.15 kB 105 kB ├ ├ /blog/code-sample ├ ├ /blog/deriving-ols-estimator ├ ├ /blog/github-markdown-guide ├ └ [+8 more paths] ├ ● /blog/page/[page] 139 B 101 kB ├ ├ /blog/page/1 ├ ├ /blog/page/2 ├ └ /blog/page/3 ├ ○ /projects 185 B 99.3 kB ├ ○ /robots.txt 0 B 0 B ├ ○ /sitemap.xml 0 B 0 B ├ ○ /tags 178 B 94.2 kB └ ● /tags/[tag] 139 B 101 kB ├ /tags/markdown ├ /tags/code ├ /tags/features └ [+14 more paths]

○ (Static) prerendered as static content ● (SSG) prerendered as static HTML (uses getStaticProps) ƒ (Dynamic) server-rendered on demand

(node:44256) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use node --trace-warnings ... to show where the warning was created) RSS feed generated...

12799@DESKTOP-B6LK9IO MINGW64 ~/tailwind-nextjs-starter-blog (main) $ ls LICENSE data/ node_modules/ scripts/ README.md faq/ package-lock.json tailwind.config.js app/ jsconfig.json package.json tsconfig.json components/ layouts/ postcss.config.js yarn.lock contentlayer.config.ts next-env.d.ts prettier.config.js css/ next.config.js public/

12799@DESKTOP-B6LK9IO MINGW64 ~/tailwind-nextjs-starter-blog (main) $

timlrx commented 1 day ago

Hi, what's the issue?

timlrx commented 1 day ago

Oh I see the question in the title. Next build does NOT generate a static site. If you want to generate a static site with an out directory, you can follow the instructions here: https://github.com/timlrx/tailwind-nextjs-starter-blog?tab=readme-ov-file#static-hosting-services-github-pages--s3--firebase-etc