@plumeria/turbopack-loader 12.0.4 → 12.0.6
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 +36 -25
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -87,6 +87,10 @@ async function loader(source) {
|
|
|
87
87
|
};
|
|
88
88
|
const localConsts = (0, utils_1.collectLocalConsts)(ast);
|
|
89
89
|
const importMap = {};
|
|
90
|
+
const keyframesImportMap = {};
|
|
91
|
+
const viewTransitionImportMap = {};
|
|
92
|
+
const createImportMap = {};
|
|
93
|
+
const variantsImportMap = {};
|
|
90
94
|
const createThemeImportMap = {};
|
|
91
95
|
const createStaticImportMap = {};
|
|
92
96
|
const plumeriaAliases = {};
|
|
@@ -122,18 +126,20 @@ async function loader(source) {
|
|
|
122
126
|
importMap[localName] = scannedTables.staticTable[uniqueKey];
|
|
123
127
|
}
|
|
124
128
|
if (scannedTables.keyframesHashTable[uniqueKey]) {
|
|
125
|
-
|
|
129
|
+
keyframesImportMap[localName] =
|
|
126
130
|
scannedTables.keyframesHashTable[uniqueKey];
|
|
127
131
|
}
|
|
128
132
|
if (scannedTables.viewTransitionHashTable[uniqueKey]) {
|
|
129
|
-
|
|
133
|
+
viewTransitionImportMap[localName] =
|
|
130
134
|
scannedTables.viewTransitionHashTable[uniqueKey];
|
|
131
135
|
}
|
|
132
136
|
if (scannedTables.createHashTable[uniqueKey]) {
|
|
133
|
-
|
|
137
|
+
createImportMap[localName] =
|
|
138
|
+
scannedTables.createHashTable[uniqueKey];
|
|
134
139
|
}
|
|
135
140
|
if (scannedTables.variantsHashTable[uniqueKey]) {
|
|
136
|
-
|
|
141
|
+
variantsImportMap[localName] =
|
|
142
|
+
scannedTables.variantsHashTable[uniqueKey];
|
|
137
143
|
}
|
|
138
144
|
if (scannedTables.createThemeHashTable[uniqueKey]) {
|
|
139
145
|
createThemeImportMap[localName] =
|
|
@@ -161,43 +167,48 @@ async function loader(source) {
|
|
|
161
167
|
const mergedKeyframesTable = {};
|
|
162
168
|
for (const key of Object.keys(scannedTables.keyframesHashTable)) {
|
|
163
169
|
mergedKeyframesTable[key] = scannedTables.keyframesHashTable[key];
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
if (typeof val === 'string') {
|
|
168
|
-
mergedKeyframesTable[key] = val;
|
|
170
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
171
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
172
|
+
mergedKeyframesTable[varName] = scannedTables.keyframesHashTable[key];
|
|
169
173
|
}
|
|
170
174
|
}
|
|
175
|
+
for (const key of Object.keys(keyframesImportMap)) {
|
|
176
|
+
mergedKeyframesTable[key] = keyframesImportMap[key];
|
|
177
|
+
}
|
|
171
178
|
const mergedViewTransitionTable = {};
|
|
172
179
|
for (const key of Object.keys(scannedTables.viewTransitionHashTable)) {
|
|
173
180
|
mergedViewTransitionTable[key] = scannedTables.viewTransitionHashTable[key];
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
mergedViewTransitionTable[key] = val;
|
|
181
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
182
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
183
|
+
mergedViewTransitionTable[varName] =
|
|
184
|
+
scannedTables.viewTransitionHashTable[key];
|
|
179
185
|
}
|
|
180
186
|
}
|
|
187
|
+
for (const key of Object.keys(viewTransitionImportMap)) {
|
|
188
|
+
mergedViewTransitionTable[key] = viewTransitionImportMap[key];
|
|
189
|
+
}
|
|
181
190
|
const mergedCreateTable = {};
|
|
182
191
|
for (const key of Object.keys(scannedTables.createHashTable)) {
|
|
183
192
|
mergedCreateTable[key] = scannedTables.createHashTable[key];
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if (typeof val === 'string') {
|
|
188
|
-
mergedCreateTable[key] = val;
|
|
193
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
194
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
195
|
+
mergedCreateTable[varName] = scannedTables.createHashTable[key];
|
|
189
196
|
}
|
|
190
197
|
}
|
|
198
|
+
for (const key of Object.keys(createImportMap)) {
|
|
199
|
+
mergedCreateTable[key] = createImportMap[key];
|
|
200
|
+
}
|
|
191
201
|
const mergedVariantsTable = {};
|
|
192
202
|
for (const key of Object.keys(scannedTables.variantsHashTable)) {
|
|
193
203
|
mergedVariantsTable[key] = scannedTables.variantsHashTable[key];
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
if (typeof val === 'string') {
|
|
198
|
-
mergedVariantsTable[key] = val;
|
|
204
|
+
if (key.startsWith(`${resourcePath}-`)) {
|
|
205
|
+
const varName = key.slice(resourcePath.length + 1);
|
|
206
|
+
mergedVariantsTable[varName] = scannedTables.variantsHashTable[key];
|
|
199
207
|
}
|
|
200
208
|
}
|
|
209
|
+
for (const key of Object.keys(variantsImportMap)) {
|
|
210
|
+
mergedVariantsTable[key] = variantsImportMap[key];
|
|
211
|
+
}
|
|
201
212
|
const mergedCreateThemeHashTable = {};
|
|
202
213
|
for (const key of Object.keys(scannedTables.createThemeHashTable)) {
|
|
203
214
|
mergedCreateThemeHashTable[key] = scannedTables.createThemeHashTable[key];
|
|
@@ -1280,7 +1291,7 @@ async function loader(source) {
|
|
|
1280
1291
|
else {
|
|
1281
1292
|
valueExpr = zss_engine_1.exceptionCamelCase.includes(targetProp)
|
|
1282
1293
|
? argSource
|
|
1283
|
-
: `(typeof ${argSource} === 'number' ? ${argSource} + 'px' : ${argSource})`;
|
|
1294
|
+
: `(typeof (${argSource}) === 'number' ? (${argSource}) + 'px' : (${argSource}))`;
|
|
1284
1295
|
}
|
|
1285
1296
|
dynamicStyleParts.push(`"${info.cssVar}": ${valueExpr}`);
|
|
1286
1297
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/turbopack-loader",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.6",
|
|
4
4
|
"description": "Plumeria Turbopack-loader",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"zero-virtual.css"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@plumeria/utils": "^12.0.
|
|
25
|
+
"@plumeria/utils": "^12.0.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@swc/core": "1.15.33",
|