@plumeria/turbopack-loader 15.1.0 → 15.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 +11 -10
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1313,9 +1313,9 @@ async function loader(source) {
1313
1313
  baseByteOffset;
1314
1314
  const end = classNameAttr.value.expression.span.end -
1315
1315
  baseByteOffset;
1316
- existingClassExpr = sourceBuffer
1316
+ existingClassExpr = `(${sourceBuffer
1317
1317
  .subarray(start, end)
1318
- .toString('utf-8');
1318
+ .toString('utf-8')})`;
1319
1319
  }
1320
1320
  }
1321
1321
  const styleAttrExisting = attributes.find((attr) => attr.type === 'JSXAttribute' &&
@@ -1428,7 +1428,7 @@ async function loader(source) {
1428
1428
  return true;
1429
1429
  });
1430
1430
  const styleAttr = dynamicStyleParts.length > 0 || existingStyleExpr
1431
- ? ` style={{ ${existingStyleExpr ? existingStyleExpr + ', ' : ''}${dynamicStyleParts.join(', ')} }}`
1431
+ ? ` style={{ ${[existingStyleExpr, ...dynamicStyleParts].filter(Boolean).join(', ')} }}`
1432
1432
  : '';
1433
1433
  const { classParts, isOptimizable, baseStyle } = buildClassParts(args, dynamicClassParts, existingClassExpr);
1434
1434
  if (isOptimizable &&
@@ -1570,6 +1570,14 @@ async function loader(source) {
1570
1570
  lastValidCss = currentCss;
1571
1571
  }
1572
1572
  }
1573
+ catch (innerError) {
1574
+ try {
1575
+ fs.writeFileSync(VIRTUAL_FILE_PATH, lastValidCss, 'utf-8');
1576
+ }
1577
+ catch (e) {
1578
+ }
1579
+ throw innerError;
1580
+ }
1573
1581
  finally {
1574
1582
  (0, file_lock_1.releaseLockSync)(LOCK_DIR_PATH);
1575
1583
  }
@@ -1584,13 +1592,6 @@ async function loader(source) {
1584
1592
  return callback(null, transformedSource + postfix);
1585
1593
  }
1586
1594
  catch (error) {
1587
- if (!isProduction) {
1588
- try {
1589
- fs.writeFileSync(VIRTUAL_FILE_PATH, lastValidCss, 'utf-8');
1590
- }
1591
- catch (e) {
1592
- }
1593
- }
1594
1595
  return callback(error);
1595
1596
  }
1596
1597
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/turbopack-loader",
3
- "version": "15.1.0",
3
+ "version": "15.1.1",
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": "^15.1.0"
25
+ "@plumeria/utils": "^15.1.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@swc/core": "1.15.41",
28
+ "@swc/core": "1.15.43",
29
29
  "zss-engine": "2.3.0"
30
30
  },
31
31
  "publishConfig": {