Skip to content

fix: rolldown-vite support (static paths + native import-analysis)#8669

Open
briancarbone wants to merge 2 commits into
QwikDev:rolldown-vite-supportfrom
briancarbone:fix/rolldown-static-paths-and-import-analysis
Open

fix: rolldown-vite support (static paths + native import-analysis)#8669
briancarbone wants to merge 2 commits into
QwikDev:rolldown-vite-supportfrom
briancarbone:fix/rolldown-static-paths-and-import-analysis

Conversation

@briancarbone
Copy link
Copy Markdown

@briancarbone briancarbone commented May 27, 2026

What is it?

  • Bug

Description

Two small build-tooling fixes required to build a Qwik Router app with rolldown-vite (Vite 8). Both surfaced while testing the rolldown-vite-support branch with Vite 8, and both let me drop workarounds I'd been carrying in my app's root and adapter vite.config.ts.

1. fix(router) - backtick-wrapped static-path placeholders

Rolldown can re-emit the __QWIK_ROUTER_STATIC_PATHS_ARRAY__ / __QWIK_ROUTER_NOT_FOUND_ARRAY__ placeholders as backtick template literals. The adapter's post-build.ts injection regex only matched single/double quotes, so the placeholders were never substituted: isStaticPath always returned false and every static asset 404'd through the SSR fallthrough. The regex now also accepts backticks.

2. fix(vite) - strip rolldown-vite's native import-analysis plugin

Qwik already removes Vite's JS vite:build-import-analysis plugin (its __vitePreload machinery is redundant with Qwik's own preloader). Under rolldown-vite that plugin has a native Rust counterpart, native:import-analysis-build, which wasn't being removed, so it kept injecting __vitePreload wrappers and __VITE_PRELOAD__ markers into QRL chunks, leaving orphaned identifiers. Added the native name to the existing removal list.

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset (two patch changesets: @qwik.dev/router, @qwik.dev/core)
  • I added new tests to cover the fix / functionality

…build

Rolldown can re-emit the __QWIK_ROUTER_*_ARRAY__ placeholders as backtick template literals, which the post-build regex (single/double quotes only) failed to replace — breaking isStaticPath so static assets 404'd via SSR fallthrough. Accept backticks too.
Under rolldown-vite (Vite 8), native:import-analysis-build (the Rust counterpart of vite:build-import-analysis) still injects __vitePreload wrappers into QRL chunks. Add it to the removal list so Qwik's own preloader handles dynamic imports.
@briancarbone briancarbone requested a review from a team as a code owner May 27, 2026 15:34
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: 0bdae28

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/core Patch
@qwik.dev/router Patch
eslint-plugin-qwik Patch
@qwik.dev/react Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant