solidjs / solidjs/solid-vite-plugin
jsx: 'preserve' in optimizeDeps breaks dependency scan when .tsx files use `import.meta.glob`
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 520
- Forks
- 70
- Avg merge
- 23h 35m
- Merged PRs (30d)
- 39
Description
Describe
The vite:dep-scan:transform:js-glob plugin asserts that the return result is js. But the vite-plugin-solid plugin sets jsx: 'preserve'.
Reproduction
https://github.com/zhylmzr/vite-plugin-solid-bug
Workarounds
- move
import.meta.globto a singlejs/tsfile. - or change
transform.jsxto:
// vite.config.ts
plugins: [
{
name: 'fix-solid-deps-scan',
enforce: 'post',
config() {
return {
optimizeDeps: {
rolldownOptions: {
transform: {
jsx: {
importSource: 'solid-js/h',
},
},
},
},
}
},
},
]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the vite:dep-scan:transform:js-glob plugin in packages/vite/src/node/optimizer/scan.ts around the referenced line, then reproduce the failure with the linked vite-plugin-solid-bug project. Trace how jsx: 'preserve' affects .tsx files using import.meta.glob. Done means dependency scanning succeeds for this case without requiring either listed workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100