Skip to content

Add Turbopack loader support and automatically adapt to Webpack#422

Open
refirst11 wants to merge 6 commits into
mui:masterfrom
refirst11:turbopack-loader
Open

Add Turbopack loader support and automatically adapt to Webpack#422
refirst11 wants to merge 6 commits into
mui:masterfrom
refirst11:turbopack-loader

Conversation

@refirst11

@refirst11 refirst11 commented Jun 5, 2026

Copy link
Copy Markdown

Overview

Closes #6
Implemented turbopack-loader.ts and integrated it into pigment-css-nextjs-plugin/src/index.ts with hybrid Webpack/Turbopack support.

Changes

  • Removed the branching within withPigment in packages/pigment-css-nextjs-plugin/src/index.ts.
  • Modified to simultaneously set up nextConfig.webpack for Webpack and nextConfig.turbopack for Turbopack, always returning an object containing both settings.

Test and Verification

Confirmed that startup, build, and style application work correctly in the following environments.

examples/pigment-css-nextjs-ts:

  • pnpm dev (Turbopack default startup) -> Starts successfully, style applied (confirmed)
  • pnpm dev --webpack (Webpack forced startup) -> Starts successfully, style applied (confirmed)
  • pnpm build -> Build succeeds without errors

How to verify locally

  1. Temporarily update pnpm-workspace.yaml to include "examples/*":

  2. In examples/pigment-css-nextjs-ts/package.json, change @pigment-css/nextjs-plugin from "latest" to "workspace:^":

  3. Run pnpm dev, pnpm build, pnpm start in both Turbopack and Webpack mode.

Styles may not be installed due to the cache in the .next file. If your .next file is old, please delete it before starting the application.

@refirst11 refirst11 force-pushed the turbopack-loader branch 2 times, most recently from 72f6cae to fa5c4ce Compare June 7, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[nextjs] Support Turbopack

1 participant