@plumeria/webpack-plugin 0.19.4 → 0.20.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/virtual-css-loader.js +10 -5
- package/package.json +1 -1
|
@@ -539,7 +539,7 @@ function loader(source) {
|
|
|
539
539
|
const { tokensTableLocal, defineTokensObjectTableLocal } = scanForDefineTokens.call(this);
|
|
540
540
|
tokensTable = tokensTableLocal;
|
|
541
541
|
defineTokensObjectTable = defineTokensObjectTableLocal;
|
|
542
|
-
|
|
542
|
+
const extractedObjects = [];
|
|
543
543
|
let ast;
|
|
544
544
|
try {
|
|
545
545
|
ast = (0, core_1.parseSync)(source, {
|
|
@@ -571,7 +571,10 @@ function loader(source) {
|
|
|
571
571
|
if (callee.property.name === 'create' &&
|
|
572
572
|
args.length === 1 &&
|
|
573
573
|
t.isObjectExpression(args[0])) {
|
|
574
|
-
|
|
574
|
+
const obj = objectExpressionToObject(args[0], constTable, keyframesHashTable, viewTransitionHashTable, tokensTable);
|
|
575
|
+
if (obj) {
|
|
576
|
+
extractedObjects.push(obj);
|
|
577
|
+
}
|
|
575
578
|
}
|
|
576
579
|
}
|
|
577
580
|
},
|
|
@@ -583,10 +586,12 @@ function loader(source) {
|
|
|
583
586
|
configFile: false,
|
|
584
587
|
});
|
|
585
588
|
const fileStyles = {};
|
|
586
|
-
if (
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
+
if (extractedObjects.length > 0) {
|
|
590
|
+
const combinedStyles = extractedObjects.reduce((acc, obj) => Object.assign(acc, obj), {});
|
|
591
|
+
const base = (0, create_1.createCSS)(combinedStyles);
|
|
592
|
+
if (base) {
|
|
589
593
|
fileStyles.baseStyles = base;
|
|
594
|
+
}
|
|
590
595
|
}
|
|
591
596
|
if (Object.keys(keyframesObjectTable).length > 0) {
|
|
592
597
|
fileStyles.keyframeStyles = Object.entries(keyframesObjectTable)
|