@plumeria/compiler 4.0.4 → 4.1.0
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/dist/index.d.ts +1 -1
- package/dist/index.js +13 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -128,11 +128,23 @@ function compileCSS(options) {
|
|
|
128
128
|
records.forEach((r) => extractedSheets.push(r.sheet));
|
|
129
129
|
};
|
|
130
130
|
if (callee.property.value === 'props') {
|
|
131
|
+
const staticStyles = [];
|
|
132
|
+
let isAllStatic = true;
|
|
131
133
|
args.forEach((arg) => {
|
|
132
134
|
const expr = arg.expression;
|
|
133
135
|
const styles = extractStylesFromExpression(expr);
|
|
134
|
-
styles.
|
|
136
|
+
if (styles.length === 0) {
|
|
137
|
+
isAllStatic = false;
|
|
138
|
+
}
|
|
139
|
+
staticStyles.push(...styles);
|
|
135
140
|
});
|
|
141
|
+
if (isAllStatic && staticStyles.length > 0) {
|
|
142
|
+
const merged = staticStyles.reduce((acc, style) => (0, utils_1.deepMerge)(acc, style), {});
|
|
143
|
+
processStyle(merged);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
staticStyles.forEach((s) => processStyle(s));
|
|
147
|
+
}
|
|
136
148
|
}
|
|
137
149
|
else if (callee.property.value === 'keyframes' &&
|
|
138
150
|
args.length > 0 &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/compiler",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Plumeria swc based compiler for statically extracting css",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"dist/"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@plumeria/utils": "^4.0
|
|
24
|
+
"@plumeria/utils": "^4.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@swc/core": "1.15.
|
|
27
|
+
"@swc/core": "1.15.8",
|
|
28
28
|
"zss-engine": "2.1.2"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|