@octanejs/stylex 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/vite.js +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/stylex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "StyleX bindings for the octane renderer — reuses StyleX's framework-agnostic compiler core and routes the generated atomic CSS through octane's stylesheet channel (client dedupe + SSR render().css).",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@babel/core": "7.29.7",
|
|
32
32
|
"@stylexjs/babel-plugin": "0.19.0",
|
|
33
33
|
"@stylexjs/stylex": "0.19.0",
|
|
34
|
-
"octane": "0.1.
|
|
34
|
+
"octane": "0.1.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/babel__core": "7.20.5",
|
package/src/vite.js
CHANGED
|
@@ -69,6 +69,16 @@ export function stylex(options = {}) {
|
|
|
69
69
|
// Run after octane's `.tsrx` -> JS transform, where `stylex.*` calls survive.
|
|
70
70
|
enforce: 'post',
|
|
71
71
|
|
|
72
|
+
// Exposed for SSR: a dev SSR server can inline the collected sheet into the
|
|
73
|
+
// server-rendered `<head>` so the first paint is styled (no flash of unstyled
|
|
74
|
+
// content) — in dev, `virtual:stylex.css` is served as JS that only injects
|
|
75
|
+
// styles AFTER the client runs. Call after the route's modules have been
|
|
76
|
+
// transformed (e.g. after `render()`), when the aggregate is complete for the
|
|
77
|
+
// current route. A production build instead extracts the sheet to a `<link>`.
|
|
78
|
+
api: {
|
|
79
|
+
getCss: () => aggregate(),
|
|
80
|
+
},
|
|
81
|
+
|
|
72
82
|
configResolved(config) {
|
|
73
83
|
isDev = options.dev ?? config.command === 'serve';
|
|
74
84
|
isBuild = config.command === 'build';
|