Title: StyleX example doesn't setup styles correctly · Issue #356 · rstackjs/rstack-examples · GitHub
Open Graph Title: StyleX example doesn't setup styles correctly · Issue #356 · rstackjs/rstack-examples
X Title: StyleX example doesn't setup styles correctly · Issue #356 · rstackjs/rstack-examples
Description: (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 fo...
Open Graph Description: (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 bui...
X Description: (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 bui...
Opengraph URL: https://github.com/rstackjs/rstack-examples/issues/356
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"StyleX example doesn't setup styles correctly","articleBody":"(1) Files generated by [rsbuild stylex example](https://github.com/rspack-contrib/rstack-examples/tree/main/rsbuild/stylex) __do not use__ the `stylex.css` file. \nInstead styles are present because of StyleX `runtimeInjection=true` feature, which [should be disabled for production builds](https://stylexjs.com/docs/api/configuration/babel-plugin/#runtimeinjection),\n\n(2) yet apparently it is enabled for production builds \n(production builds being considered the result of `rsbuild build` command, i.e. `\"build\"` script in `package.json`)\n\nand if runtimeInjection is force-disabled like this:\n```js\n tools: {\n rspack: {\n plugins: [stylexPlugin({\n stylex: {\n runtimeInjection: false,\n }\n })],\n },\n },\n```\n\nthen styles are not loaded by the browser at all\n\nThe [unplugin-stylex rsbuild](https://github.com/eryue0220/unplugin-stylex/tree/main/examples/rsbuild-example) example [solves this](https://github.com/eryue0220/unplugin-stylex/blob/main/examples/rsbuild-example/public/index.html#L16) by embedding the `\u003clink rel=\"stylesheet\" href=\"stylex.css\"\u003e` to the template `index.html`\n\n(3) As a result, the `output.inlineStyles=true` doesn't work for the `stylex.css` file generated by the plugin.\n(the reason I wrote this github-issue is because of this third problem)\n\nGit repo to reproduce: https://github.com/mechan1sm/stylex-bug-reproduce-1","author":{"url":"https://github.com/mechan1sm","@type":"Person","name":"mechan1sm"},"datePublished":"2025-10-08T05:57:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/356/rstack-examples/issues/356"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b1cdbdae-d188-738e-d688-f1b55538fe30 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCA8:1F57E3:678BDA:8954E8:697160D4 |
| html-safe-nonce | a1e5a9316760653c934facf3b2899ec3bd32701b5451630f3f2aec2db7eb442c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0E4OjFGNTdFMzo2NzhCREE6ODk1NEU4OjY5NzE2MEQ0IiwidmlzaXRvcl9pZCI6IjcyMDcxNjQyNTUwMDQ2MTQ4NjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3a464669b3cc7b9bd464afa4762f534759c12539438513e3f3876da9d19a83ca |
| hovercard-subject-tag | issue:3493958688 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/rstackjs/rstack-examples/356/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d4c38c0aca6b4c3f4642b63dc954578433f6a74747bb167fe3a54f3f132767f2/rstackjs/rstack-examples/issues/356 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d4c38c0aca6b4c3f4642b63dc954578433f6a74747bb167fe3a54f3f132767f2/rstackjs/rstack-examples/issues/356 |
| og:image:alt | (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 bui... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mechan1sm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1c338feb2465fb28789c852d4d9bbb3a30c0620671d1df7914edfbde84531d5e |
| turbo-cache-control | no-preview |
| go-import | github.com/rstackjs/rstack-examples git https://github.com/rstackjs/rstack-examples.git |
| octolytics-dimension-user_id | 129049372 |
| octolytics-dimension-user_login | rstackjs |
| octolytics-dimension-repository_id | 721103420 |
| octolytics-dimension-repository_nwo | rstackjs/rstack-examples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 721103420 |
| octolytics-dimension-repository_network_root_nwo | rstackjs/rstack-examples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca28321bb5dd58db88720c48080666bfbe28520a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width