@plumeria/webpack-plugin 6.1.0 → 6.1.2
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 +27 -27
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -151,6 +151,9 @@ function loader(source) {
|
|
|
151
151
|
const processedDecls = new Set();
|
|
152
152
|
const idSpans = new Set();
|
|
153
153
|
const excludedSpans = new Set();
|
|
154
|
+
if (scannedTables.extractedSheet) {
|
|
155
|
+
addSheet(scannedTables.extractedSheet);
|
|
156
|
+
}
|
|
154
157
|
const checkVariantAssignment = (decl) => {
|
|
155
158
|
if (decl.init &&
|
|
156
159
|
utils_1.t.isCallExpression(decl.init) &&
|
|
@@ -388,39 +391,36 @@ function loader(source) {
|
|
|
388
391
|
if (utils_1.t.isIdentifier(node.object) && utils_1.t.isIdentifier(node.property)) {
|
|
389
392
|
const varName = node.object.value;
|
|
390
393
|
const propName = node.property.value;
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
+
const uniqueKey = `${this.resourcePath}-${varName}`;
|
|
395
|
+
let hash = scannedTables.createHashTable[uniqueKey];
|
|
396
|
+
if (!hash) {
|
|
397
|
+
hash = mergedCreateTable[varName];
|
|
398
|
+
}
|
|
399
|
+
if (!hash) {
|
|
400
|
+
const styleInfo = localCreateStyles[varName];
|
|
401
|
+
if (styleInfo) {
|
|
402
|
+
const atomMap = styleInfo.hashMap[propName];
|
|
403
|
+
if (atomMap) {
|
|
404
|
+
replacements.push({
|
|
405
|
+
start: node.span.start - ast.span.start,
|
|
406
|
+
end: node.span.end - ast.span.start,
|
|
407
|
+
content: JSON.stringify(atomMap),
|
|
408
|
+
});
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (hash) {
|
|
414
|
+
let atomMap;
|
|
415
|
+
if (scannedTables.createAtomicMapTable[hash]) {
|
|
416
|
+
atomMap = scannedTables.createAtomicMapTable[hash][propName];
|
|
417
|
+
}
|
|
394
418
|
if (atomMap) {
|
|
395
419
|
replacements.push({
|
|
396
420
|
start: node.span.start - ast.span.start,
|
|
397
421
|
end: node.span.end - ast.span.start,
|
|
398
422
|
content: JSON.stringify(atomMap),
|
|
399
423
|
});
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
const hash = mergedCreateTable[varName];
|
|
404
|
-
if (hash) {
|
|
405
|
-
const obj = scannedTables.createObjectTable[hash];
|
|
406
|
-
if (obj && obj[propName]) {
|
|
407
|
-
const style = obj[propName];
|
|
408
|
-
if (typeof style === 'object' && style !== null) {
|
|
409
|
-
const records = (0, utils_1.getStyleRecords)(propName, style, 2);
|
|
410
|
-
if (!isProduction) {
|
|
411
|
-
(0, utils_1.extractOndemandStyles)(style, extractedSheets, scannedTables);
|
|
412
|
-
records.forEach((r) => addSheet(r.sheet));
|
|
413
|
-
}
|
|
414
|
-
const atomMap = {};
|
|
415
|
-
records.forEach((r) => (atomMap[r.key] = r.hash));
|
|
416
|
-
if (Object.keys(atomMap).length > 0) {
|
|
417
|
-
replacements.push({
|
|
418
|
-
start: node.span.start - ast.span.start,
|
|
419
|
-
end: node.span.end - ast.span.start,
|
|
420
|
-
content: JSON.stringify(atomMap),
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/webpack-plugin",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.2",
|
|
4
4
|
"description": "Plumeria Webpack plugin",
|
|
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": "^6.1.
|
|
25
|
+
"@plumeria/utils": "^6.1.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@swc/core": "1.15.8",
|