rstackjs / rstackjs/rstack-examples
StyleX example doesn't setup styles correctly
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 168
- 派生
- 47
- 平均合并
- 3 小时 45 分钟
- 30 天内合并 PR
- 11
描述
(1) Files generated by rsbuild stylex example do not use the stylex.css file.
Instead styles are present because of StyleX runtimeInjection=true feature, which should be disabled for production builds,
(2) yet apparently it is enabled for production builds
(production builds being considered the result of rsbuild build command, i.e. "build" script in package.json)
and if runtimeInjection is force-disabled like this:
tools: {
rspack: {
plugins: [stylexPlugin({
stylex: {
runtimeInjection: false,
}
})],
},
},
then styles are not loaded by the browser at all
The unplugin-stylex rsbuild example solves this by embedding the <link rel="stylesheet" href="stylex.css"> to the template index.html
(3) As a result, the output.inlineStyles=true doesn't work for the stylex.css file generated by the plugin.
(the reason I wrote this github-issue is because of this third problem)
Git repo to reproduce: https://github.com/mechan1sm/stylex-bug-reproduce-1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
Start with the rsbuild/stylex example, its package.json build script, and the generated stylex.css referenced in the report. Reproduce with rsbuild build, then compare the production HTML and CSS output with the linked unplugin-stylex example's public/index.html. Done means production styles load without runtime injection and output.inlineStyles handles stylex.css as intended.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- build-system, frontend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100