Skip to content

Commit 9c35100

Browse files
fix(swingset): scan mosaic source for stylex css extraction
The postcss plugin's package auto-discovery only recognizes a dependency as a StyleX package when its manifest lists `@stylexjs/stylex` under dependencies, peerDependencies, or optionalDependencies. Moving it to `@clerk/ui`'s devDependencies silently dropped `packages/ui/src/mosaic` from extraction, so no `:root { --cl-* }` token defaults were emitted and the preview deploy rendered unstyled. Name the source in `include` instead of relying on discovery.
1 parent 4486d33 commit 9c35100

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/swingset/postcss.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ const isDev = process.env.NODE_ENV !== 'production';
2121
// `runtimeInjection` (see `next.config.mjs`) injects the *fresh* atom at runtime under a new
2222
// content hash, which HMR tracks. The stale extracted atom is dead CSS; the `:root` token
2323
// defaults never change mid-session, so they stay correct.
24+
//
25+
// `include` names the Mosaic source explicitly: the plugin's auto-discovery ignores
26+
// `devDependencies`, which is where `@clerk/ui` keeps `@stylexjs/stylex`.
2427
const stylexExtraction = {
2528
'@stylexjs/postcss-plugin': {
29+
include: ['src/**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}', `${uiRoot}/src/mosaic/**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}`],
2630
useCSSLayers: true,
2731
babelConfig: {
2832
babelrc: false,

0 commit comments

Comments
 (0)