Skip to content

Migrate app from Webpack SPA to Next.js pages router#1

Merged
kabeier merged 9 commits into
mainfrom
codex/migrate-project-from-webpack-to-next.js
Feb 26, 2026
Merged

Migrate app from Webpack SPA to Next.js pages router#1
kabeier merged 9 commits into
mainfrom
codex/migrate-project-from-webpack-to-next.js

Conversation

@kabeier

@kabeier kabeier commented Feb 26, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Move the project from a Webpack single-page app to Next.js pages routing to adopt Next conventions for routing, simplify build/runtime commands, and preserve existing layout and error handling while keeping react/react-dom as framework peers.

Description

  • Replace Webpack build/dev/start flow in package.json with Next equivalents (dev: next dev, build: next build, start: next start -p 4173) and add next while removing Webpack/Babel/loader and react-router-dom dependencies and related scripts.
  • Add Next pages router files pages/index.tsx, pages/projects.tsx, pages/about.tsx, pages/404.tsx and create pages/_app.tsx to import global CSS and wrap all pages with the existing ErrorBoundary and shared Layout.
  • Convert src/components/Layout.tsx to use next/link and render children instead of React Router NavLink/Outlet, and remove SPA bootstrap/entry files and webpack.config.cjs and public/index.html which are no longer required.
  • Update TypeScript config (tsconfig.json) to include Next-required globs and plugin settings and add next-env.d.ts, and update src/App.test.tsx tests to render pages via the new Layout composition instead of relying on the SPA router bootstrap.

Testing

  • Attempted npm install to install next failed due to an environment registry policy returning 403 Forbidden, preventing installation of Next and its types so full validation could not complete (install failed).
  • Ran npm run test:run (Vitest) which initially failed on alias resolution and was adjusted, but ultimately fails to resolve next/link in tests because next is not installed, so unit tests did not pass.
  • Ran npm run typecheck which reported missing next module/type errors for next/link and next/app because next is not installed, so typecheck did not pass.
  • Attempted a Playwright page load/screenshot against http://127.0.0.1:4173 but no Next server was available (request returned ERR_EMPTY_RESPONSE), so end-to-end verification could not be completed.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@kabeier kabeier merged commit 1763486 into main Feb 26, 2026
1 check passed
@kabeier kabeier deleted the codex/migrate-project-from-webpack-to-next.js branch February 26, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant