-
Notifications
You must be signed in to change notification settings - Fork 40
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 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