@plumeria/turbopack-loader 4.0.5 → 4.1.1

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 +10 -13
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -196,11 +196,10 @@ async function loader(source) {
196
196
  if (styleInfo && !styleInfo.hasDynamicAccess) {
197
197
  const atomMap = styleInfo.hashMap[node.property.value];
198
198
  if (atomMap) {
199
- const combinedHash = Object.values(atomMap).join(' ');
200
199
  replacements.push({
201
200
  start: node.span.start - ast.span.start,
202
201
  end: node.span.end - ast.span.start,
203
- content: JSON.stringify(combinedHash),
202
+ content: JSON.stringify(atomMap),
204
203
  });
205
204
  }
206
205
  }
@@ -252,29 +251,27 @@ async function loader(source) {
252
251
  return false;
253
252
  };
254
253
  const allStatic = args.every((arg) => checkStatic(arg.expression));
255
- if (allStatic) {
256
- const merged = {};
257
- args.forEach((arg) => {
254
+ if (allStatic && args.length > 0) {
255
+ const merged = args.reduce((acc, arg) => {
258
256
  const expr = arg.expression;
259
257
  if (utils_1.t.isObjectExpression(expr)) {
260
258
  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);
259
+ return obj ? (0, utils_1.deepMerge)(acc, obj) : acc;
262
260
  }
263
261
  else if (utils_1.t.isMemberExpression(expr) &&
264
262
  utils_1.t.isIdentifier(expr.object) &&
265
263
  utils_1.t.isIdentifier(expr.property)) {
266
264
  const styleInfo = localCreateStyles[expr.object.value];
267
- if (styleInfo) {
268
- Object.assign(merged, styleInfo.obj[expr.property.value]);
269
- }
265
+ return styleInfo
266
+ ? (0, utils_1.deepMerge)(acc, styleInfo.obj[expr.property.value])
267
+ : acc;
270
268
  }
271
269
  else if (utils_1.t.isIdentifier(expr)) {
272
270
  const styleInfo = localCreateStyles[expr.value];
273
- if (styleInfo) {
274
- Object.assign(merged, styleInfo.obj);
275
- }
271
+ return styleInfo ? (0, utils_1.deepMerge)(acc, styleInfo.obj) : acc;
276
272
  }
277
- });
273
+ return acc;
274
+ }, {});
278
275
  if (Object.keys(merged).length > 0) {
279
276
  (0, utils_1.extractOndemandStyles)(merged, extractedSheets);
280
277
  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.5",
3
+ "version": "4.1.1",
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": "^4.0.5"
25
+ "@plumeria/utils": "^4.1.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@swc/core": "1.15.8",