블로그만들어서 배포함 (SSG)
1. 로컬에서 빌드 후 프로덕션모드에서 잘 됨 (build 단계에서 static site generation)
근데 netlify에서 배포 쳐 하면 분명 ssg로 빌드하는데 (아래 로그 첨부) 정작 접속해보면 route 바뀔때마다 네트워크 요청 쳐함 ㅅㅂ
왜 빌드할때 페이지 쳐 만들어놓고 계속 ssr처럼 동작하는거냐....
6:37:37 PM: Netlify Build
6:37:37 PM: ────────────────────────────────────────────────────────────────
6:37:37 PM:
6:37:37 PM: ❯ Version
6:37:37 PM: @netlify/build 29.15.6
6:37:37 PM:
6:37:37 PM: ❯ Flags
6:37:37 PM: baseRelDir: true
6:37:37 PM: buildId: 64ad22c9b00a85000710368f
6:37:37 PM: deployId: 64ad22c9b00a850007103691
6:37:37 PM:
6:37:37 PM: ❯ Current directory
6:37:37 PM: /opt/build/repo
6:37:37 PM:
6:37:37 PM: ❯ Config file
6:37:37 PM: No config file was defined: using default values.
6:37:37 PM:
6:37:37 PM: ❯ Context
6:37:37 PM: production
6:37:37 PM:
6:37:37 PM: ❯ Installing plugins
6:37:37 PM: - @netlify/plugin-nextjs@4.39.0
6:37:46 PM:
6:37:46 PM: ❯ Using Next.js Runtime - v4.39.0
6:37:47 PM:
6:37:47 PM: @netlify/plugin-nextjs (onPreBuild event)
6:37:47 PM: ────────────────────────────────────────────────────────────────
6:37:47 PM:
6:37:47 PM: No Next.js cache to restore.
6:37:47 PM: Netlify configuration property build.environment.NEXT_PRIVATE_TARGET value changed.
6:37:47 PM:
6:37:47 PM: (@netlify/plugin-nextjs onPreBuild completed in 17ms)
6:37:47 PM:
6:37:47 PM: Build command from Netlify app
6:37:47 PM: ────────────────────────────────────────────────────────────────
6:37:47 PM:
6:37:47 PM: $ CI=false npm run build
6:37:47 PM: > my-ssg-blog@0.1.0 build
6:37:47 PM: > next build
6:37:48 PM: - warn No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
6:37:48 PM: - info Linting and checking validity of types...
6:37:49 PM: - info Creating an optimized production build...
6:37:54 PM: - info Compiled successfully
6:37:54 PM: - info Collecting page data...
6:38:04 PM: - info Generating static pages (0/6)
6:38:04 PM: - info Generating static pages (1/6)
6:38:04 PM: - info Generating static pages (2/6)
6:38:04 PM: - info Generating static pages (4/6)
6:38:04 PM: - info Generating static pages (6/6)
6:38:06 PM: - info Finalizing page optimization...
6:38:06 PM: Route (pages) Size First Load JS
6:38:06 PM: ┌ + / 579 B 77.6 kB
6:38:06 PM: ├ /_app 0 B 74.6 kB
6:38:06 PM: ├ + /404 182 B 74.8 kB
6:38:06 PM: └ + /posts/[slug] (1152 ms) 418 B 77.5 kB
6:38:06 PM: ├ /posts/third-content copy (417 ms)
6:38:06 PM: ├ /posts/first-content (379 ms)
6:38:06 PM: └ /posts/second-content (356 ms)
6:38:06 PM: + First Load JS shared by all 76.3 kB
6:38:06 PM: ├ chunks/framework-305cb810cde7afac.js 45.2 kB
6:38:06 PM: ├ chunks/main-bfbd70c9b9a5a25b.js 28.4 kB
6:38:06 PM: ├ chunks/pages/_app-6d4db059040e5e6f.js 296 B
6:38:06 PM: ├ chunks/webpack-8fa1640cc84ba8fe.js 750 B
6:38:06 PM: └ css/aa3a95a3ffee19ec.css 1.62 kB
6:38:06 PM: + (Static) automatically rendered as static HTML (uses no initial props)
6:38:06 PM: + (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
6:38:06 PM:
6:38:06 PM: (build.command completed in 18.9s)
댓글 0