jsx: 'preserve' in optimizeDeps breaks dependency scan when .tsx files use `import.meta.glob`
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript, vite
- 领域
- build-system, frontend
调研方向
先从 packages/vite/src/node/optimizer/scan.ts 中引用行附近的 vite:dep-scan:transform:js-glob 插件开始,然后使用链接的 vite-plugin-solid-bug 项目重现该故障。跟踪 jsx: 'preserve' 如何影响使用 import.meta.glob 的 .tsx 文件。对于此案例,依赖扫描无需任一所列 workaround 即可成功,才算完成。
由索引模型根据 Issue 内容生成。
描述
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',
},
},
},
},
}
},
},
]
- 主要语言
- TypeScript
- 星标
- 522
- 派生
- 72
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid-vite-plugin 的其他 Issue
-
Test environment detection doesn't consider Vitest workspaces可能已有人在做 @carloitaben 于 44 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
solidjs/solid-vite-plugin#205 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 65/100
solidjs/solid-vite-plugin#394 ·
维护者通常 1 天内回复
-
Catch-all route chunks are named `_...404_-<hash>.js`; the `..` trips path-traversal guards and breaks the lazy preload可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
solidjs/solid-vite-plugin#391 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
solidjs/solid-vite-plugin#390 ·
维护者通常 1 天内回复
-
Start mode: generated entries render without the CSP nonce, and there is no per-request seam to supply one可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 35/100
solidjs/solid-vite-plugin#388 · 1 条评论 ·
维护者通常 1 天内回复
查看 solidjs/solid-vite-plugin 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
solana-foundation/solana-com#2245 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
`document.cookie` with `max-age=0` does not delete the cookie可能已有人在做 @BartInTheField 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
capricorn86/happy-dom#2460 ·
维护者通常 2 天内回复