Skip to content

Re-enable Turbopack once ::highlight() pseudo-element support is added #79

@monneyboi

Description

@monneyboi

Context

We are currently using webpack instead of Turbopack (Next.js 16's default bundler) because Turbopack's CSS parser (LightningCSS) does not yet support the ::highlight() pseudo-element, which we use for text highlighting in archived pages.

Current Workaround

Added --webpack flag to build and dev scripts in package.json to use webpack instead of Turbopack.

"dev": "next dev --webpack",
"build": "next build --webpack"

When to Re-enable Turbopack

Once the following upstream issues are resolved:

  1. LightningCSS PR #970: Adds support for ::highlight() pseudo-element

  2. Next.js Issue #85398: Tracks the ::highlight() parsing error in Turbopack

Action Items

  • Monitor LightningCSS PR #970 for merge
  • Wait for Next.js to update its LightningCSS dependency
  • Test build with Turbopack (remove --webpack flags)
  • Remove webpack flags from package.json scripts once verified working

Related Code

  • CSS usage: src/app/globals.css (line 50)
  • Runtime usage: src/lib/textHighlighter.ts
  • Injected styles: src/app/api/archived-pages/[id]/html/route.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    guiGUI/interface related issues

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions