@plumeria/turbopack-loader 18.3.16 → 18.3.17
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.js +9 -9
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -217,18 +217,18 @@ const findVarProp = (style, cssVar) => {
|
|
|
217
217
|
}
|
|
218
218
|
return undefined;
|
|
219
219
|
};
|
|
220
|
-
const
|
|
220
|
+
const applyVarFallback = (style, cssVar, literal) => {
|
|
221
|
+
const reference = `var(${cssVar})`;
|
|
221
222
|
for (const [prop, value] of Object.entries(style)) {
|
|
222
|
-
if (typeof value === 'string' && value.includes(
|
|
223
|
-
style[prop] =
|
|
224
|
-
|
|
223
|
+
if (typeof value === 'string' && value.includes(reference)) {
|
|
224
|
+
style[prop] = value
|
|
225
|
+
.split(reference)
|
|
226
|
+
.join(`var(${cssVar}, ${(0, zss_engine_1.applyCssValue)(literal, (0, zss_engine_1.camelToKebabCase)(prop))})`);
|
|
225
227
|
}
|
|
226
|
-
if (value !== null && typeof value === 'object') {
|
|
227
|
-
|
|
228
|
-
return true;
|
|
228
|
+
else if (value !== null && typeof value === 'object') {
|
|
229
|
+
applyVarFallback(value, cssVar, literal);
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
|
-
return false;
|
|
232
232
|
};
|
|
233
233
|
async function loader(source) {
|
|
234
234
|
const callback = this.async();
|
|
@@ -1046,7 +1046,7 @@ async function loader(source) {
|
|
|
1046
1046
|
: undefined;
|
|
1047
1047
|
if (literal === undefined)
|
|
1048
1048
|
return;
|
|
1049
|
-
|
|
1049
|
+
applyVarFallback(style, cssVar, literal);
|
|
1050
1050
|
});
|
|
1051
1051
|
const vars = [];
|
|
1052
1052
|
runtime.forEach(({ param, source }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/turbopack-loader",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.17",
|
|
4
4
|
"description": "Plumeria Turbopack-loader",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"zero-virtual.css"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@plumeria/compiler": "^18.3.
|
|
33
|
-
"@plumeria/utils": "^18.3.
|
|
32
|
+
"@plumeria/compiler": "^18.3.17",
|
|
33
|
+
"@plumeria/utils": "^18.3.17"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@swc/core": "1.15.47",
|