Skip to content

fix: dedupe extensions array in JS-converted solid-v2 vite config - #84

Merged
ryansolid merged 1 commit into
mainfrom
fix/solid-v2-js-extensions-dedupe
Aug 12, 2026
Merged

fix: dedupe extensions array in JS-converted solid-v2 vite config#84
ryansolid merged 1 commit into
mainfrom
fix/solid-v2-js-extensions-dedupe

Conversation

@ryansolid

Copy link
Copy Markdown
Contributor

Summary

  • Found during Failed to load url ~/entry-server.tsx (trying to find .tsx instead of .jsx) #73's verification: scaffolding the Solid 2.0 basic template with --js produced extensions: ['.jsx', '.jsx'] in the converted vite.config.js. The TS template lists extensions: ['.jsx', '.tsx'], and the blanket .tsx.jsx retarget regex added in feat: Solid 2.0 template support #82 rewrites the second entry into a duplicate of the first.
  • Extracted the retarget into a retargetTSFilenames helper that dedupes the extensions array after the rewrite — the converted config now reads extensions: ['.jsx'].
  • Also retargets .ts/.tsx filename mentions in the config's comments and the template README (e.g. src/App.tsxsrc/App.jsx, `vite.config.ts``vite.config.js`), since every such file is renamed by the conversion. .d.ts mentions are excluded — those files are deleted, not transpiled. .tsx mentions inside transpiled src/ sources (JSX text/comments in the route files) are intentionally left as is; rewriting sucrase output in the shared conversion path is out of scope for this fix.
  • No changeset: like fix: use @solidjs/web as jsxImportSource in solid-v2 jsconfig #83, this only touches unreleased code already covered by the pending solid-v2-templates changeset for 0.9.0.

Test plan

  • Root pnpm test — 18/18 passing (16 existing + 2 new unit tests for the retarget against the solid-v2-basic fixture)
  • Re-scaffolded solid-v2 basic with JS conversion from the local build: config is extensions: ['.jsx'], no stale .tsx in config/README
  • npm run dev on the converted app: / and /users serve 200, and /src/routes/index.jsx?pick=default&pick=route compiles through the Solid transform (the extensions option's purpose)

Made with Cursor

The blanket `.tsx` -> `.jsx` retarget regex in createSolidV2JS rewrote
both entries of `extensions: ['.jsx', '.tsx']` to the same value,
leaving `['.jsx', '.jsx']` in the converted vite.config.js. Dedupe the
array after the rewrite, and also retarget `.ts`/`.tsx` filename
mentions in config comments and the README (`.d.ts` mentions are left
alone since those files are deleted, not transpiled).
Co-authored-by: Cursor <cursoragent@cursor.com>
@ryansolid
ryansolid merged commit 2e3d938 into mainAug 12, 2026
3 checks passed
@ryansolid
ryansolid deleted the fix/solid-v2-js-extensions-dedupe branch August 12, 2026 15:16
Sign up for freeto 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

@ryansolid