bunchee 6.3.3 → 6.3.4

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/bin/cli.js CHANGED
@@ -647,7 +647,7 @@ function lint$1(pkg) {
647
647
  }
648
648
  }
649
649
 
650
- var version = "6.3.3";
650
+ var version = "6.3.4";
651
651
 
652
652
  async function writeDefaultTsconfig(tsConfigPath) {
653
653
  await fs.promises.writeFile(tsConfigPath, JSON.stringify(DEFAULT_TS_CONFIG, null, 2), 'utf-8');
package/dist/index.js CHANGED
@@ -1369,10 +1369,19 @@ function aliasEntries({ entry: sourceFilePath, conditionNames, entries, format,
1369
1369
  })) == null ? undefined : _exportMapEntries_find1.bundlePath;
1370
1370
  }
1371
1371
  } else {
1372
- var _exportMapEntries_find2;
1373
- matchedBundlePath = (_exportMapEntries_find2 = exportMapEntries.find((item)=>{
1372
+ var _exportMapEntries_sort_find;
1373
+ matchedBundlePath = (_exportMapEntries_sort_find = exportMapEntries.sort(// always put special condition after the general condition (default, cjs, esm)
1374
+ (a, b)=>{
1375
+ if (a.conditionNames.has(specialCondition)) {
1376
+ return -1;
1377
+ }
1378
+ if (b.conditionNames.has(specialCondition)) {
1379
+ return 1;
1380
+ }
1381
+ return 0;
1382
+ }).find((item)=>{
1374
1383
  return findJsBundlePathCallback(item, specialCondition);
1375
- })) == null ? undefined : _exportMapEntries_find2.bundlePath;
1384
+ })) == null ? undefined : _exportMapEntries_sort_find.bundlePath;
1376
1385
  }
1377
1386
  if (matchedBundlePath) {
1378
1387
  if (!sourceToRelativeBundleMap.has(exportCondition.source)) sourceToRelativeBundleMap.set(exportCondition.source, matchedBundlePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "6.3.3",
3
+ "version": "6.3.4",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",