Skip to content

Commit 79ff4f9

Browse files
committed
apply plugin to exported constants
1 parent 3eec5a6 commit 79ff4f9

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ function stylexKeySort(
7878
return;
7979
}
8080

81-
for (const node of program.body) {
81+
for (let node of program.body) {
82+
if (node.type === 'ExportNamedDeclaration' && node.declaration) {
83+
node = node.declaration;
84+
}
8285
if (node.type !== 'VariableDeclaration') {
8386
continue;
8487
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as stylex from '@stylexjs/stylex';
2+
export const styles = stylex.create({
3+
foo: {
4+
display: 'flex',
5+
borderColor: 'red',
6+
alignItems: 'center',
7+
},
8+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as stylex from '@stylexjs/stylex';
2+
export const styles = stylex.create({
3+
foo: {
4+
alignItems: 'center',
5+
borderColor: 'red',
6+
display: 'flex',
7+
},
8+
});

0 commit comments

Comments
 (0)