@plumeria/turbopack-loader 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.
Files changed (2) hide show
  1. package/dist/index.js +9 -11
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -252,29 +252,27 @@ async function loader(source) {
252
252
  return false;
253
253
  };
254
254
  const allStatic = args.every((arg) => checkStatic(arg.expression));
255
- if (allStatic) {
256
- const merged = {};
257
- args.forEach((arg) => {
255
+ if (allStatic && args.length > 0) {
256
+ const merged = args.reduce((acc, arg) => {
258
257
  const expr = arg.expression;
259
258
  if (utils_1.t.isObjectExpression(expr)) {
260
259
  const obj = (0, utils_1.objectExpressionToObject)(expr, utils_1.tables.staticTable, utils_1.tables.keyframesHashTable, utils_1.tables.viewTransitionHashTable, utils_1.tables.themeTable);
261
- obj && Object.assign(merged, obj);
260
+ return obj ? (0, utils_1.deepMerge)(acc, obj) : acc;
262
261
  }
263
262
  else if (utils_1.t.isMemberExpression(expr) &&
264
263
  utils_1.t.isIdentifier(expr.object) &&
265
264
  utils_1.t.isIdentifier(expr.property)) {
266
265
  const styleInfo = localCreateStyles[expr.object.value];
267
- if (styleInfo) {
268
- Object.assign(merged, styleInfo.obj[expr.property.value]);
269
- }
266
+ return styleInfo
267
+ ? (0, utils_1.deepMerge)(acc, styleInfo.obj[expr.property.value])
268
+ : acc;
270
269
  }
271
270
  else if (utils_1.t.isIdentifier(expr)) {
272
271
  const styleInfo = localCreateStyles[expr.value];
273
- if (styleInfo) {
274
- Object.assign(merged, styleInfo.obj);
275
- }
272
+ return styleInfo ? (0, utils_1.deepMerge)(acc, styleInfo.obj) : acc;
276
273
  }
277
- });
274
+ return acc;
275
+ }, {});
278
276
  if (Object.keys(merged).length > 0) {
279
277
  (0, utils_1.extractOndemandStyles)(merged, extractedSheets);
280
278
  const hash = (0, zss_engine_1.genBase36Hash)(merged, 1, 8);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/turbopack-loader",
3
- "version": "4.0.4",
3
+ "version": "4.1.0",
4
4
  "description": "Plumeria Turbopack-loader",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -22,10 +22,10 @@
22
22
  "zero-virtual.css"
23
23
  ],
24
24
  "dependencies": {
25
- "@plumeria/utils": "^4.0.4"
25
+ "@plumeria/utils": "^4.1.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@swc/core": "1.15.2",
28
+ "@swc/core": "1.15.8",
29
29
  "zss-engine": "2.1.2"
30
30
  },
31
31
  "publishConfig": {