bunchee 5.1.0 → 5.1.2
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/README.md +1 -1
- package/dist/bin/cli.js +4 -4
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,7 +165,7 @@ Assuming you have default export package as `"."` and subpath export `"./lite"`
|
|
|
165
165
|
"build": "bunchee"
|
|
166
166
|
},
|
|
167
167
|
"exports": {
|
|
168
|
-
"./lite": "./dist/lite.js"
|
|
168
|
+
"./lite": "./dist/lite.js",
|
|
169
169
|
".": {
|
|
170
170
|
"import": "./dist/index.mjs",
|
|
171
171
|
"require": "./dist/index.cjs"
|
package/dist/bin/cli.js
CHANGED
|
@@ -474,7 +474,7 @@ function lint$1(pkg) {
|
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
var version = "5.1.
|
|
477
|
+
var version = "5.1.2";
|
|
478
478
|
|
|
479
479
|
function relativify(path) {
|
|
480
480
|
return path.startsWith('.') ? path : `./${path}`;
|
|
@@ -555,7 +555,7 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
|
|
|
555
555
|
});
|
|
556
556
|
for (const binDirent of binDirentList){
|
|
557
557
|
if (binDirent.isFile()) {
|
|
558
|
-
const binFileAbsolutePath = path__default.default.join(
|
|
558
|
+
const binFileAbsolutePath = path__default.default.join(absoluteDirPath, binDirent.name);
|
|
559
559
|
if (fs__default.default.existsSync(binFileAbsolutePath)) {
|
|
560
560
|
bins.set(normalizeExportPath(originalSubpath), binFileAbsolutePath);
|
|
561
561
|
}
|
|
@@ -610,7 +610,7 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
|
|
|
610
610
|
if (isTestFile(dirent.name)) {
|
|
611
611
|
continue;
|
|
612
612
|
}
|
|
613
|
-
const sourceFileAbsolutePath = path__default.default.join(
|
|
613
|
+
const sourceFileAbsolutePath = path__default.default.join(dirPath, dirent.name);
|
|
614
614
|
if (isBinaryPath) {
|
|
615
615
|
bins.set(originalSubpath, sourceFileAbsolutePath);
|
|
616
616
|
} else {
|
|
@@ -656,7 +656,7 @@ async function collectSourceEntries(sourceFolderPath) {
|
|
|
656
656
|
const binDirent = entryFileDirentList.find((dirent)=>getFileBasename(dirent.name) === 'bin');
|
|
657
657
|
if (binDirent) {
|
|
658
658
|
if (binDirent.isDirectory()) {
|
|
659
|
-
const binDirentList = await fsp__default.default.readdir(path__default.default.join(
|
|
659
|
+
const binDirentList = await fsp__default.default.readdir(path__default.default.join(sourceFolderPath, binDirent.name), {
|
|
660
660
|
withFileTypes: true
|
|
661
661
|
});
|
|
662
662
|
for (const binDirent of binDirentList){
|
package/dist/index.js
CHANGED
|
@@ -125,6 +125,7 @@ const dtsExtensionsMap = {
|
|
|
125
125
|
mjs: 'd.mts'
|
|
126
126
|
};
|
|
127
127
|
const disabledWarnings = new Set([
|
|
128
|
+
'EMPTY_BUNDLE',
|
|
128
129
|
'MIXED_EXPORTS',
|
|
129
130
|
'PREFER_NAMED_EXPORTS',
|
|
130
131
|
'UNRESOLVED_IMPORT',
|
|
@@ -550,7 +551,8 @@ function aliasEntries({ entry, entries, entriesAlias, format, dts, cwd }) {
|
|
|
550
551
|
const typeCond = (_Object_entries_find = Object.entries(exportDistMaps).find(([composedKey, cond])=>{
|
|
551
552
|
const typesSet = new Set(composedKey.split('.'));
|
|
552
553
|
const formatCond = format === 'cjs' ? 'require' : 'import';
|
|
553
|
-
|
|
554
|
+
const isMatchedCond = typesSet.has(formatCond) || !typesSet.has('import') && !typesSet.has('require');
|
|
555
|
+
return typesSet.has('types') && isMatchedCond && cond != null;
|
|
554
556
|
})) == null ? void 0 : _Object_entries_find[1];
|
|
555
557
|
if (typeCond) {
|
|
556
558
|
pathToRelativeDistMap.set(exportCondition.source, typeCond);
|
|
@@ -1021,7 +1023,7 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
|
|
|
1021
1023
|
});
|
|
1022
1024
|
for (const binDirent of binDirentList){
|
|
1023
1025
|
if (binDirent.isFile()) {
|
|
1024
|
-
const binFileAbsolutePath = path__default.default.join(
|
|
1026
|
+
const binFileAbsolutePath = path__default.default.join(absoluteDirPath, binDirent.name);
|
|
1025
1027
|
if (fs__default.default.existsSync(binFileAbsolutePath)) {
|
|
1026
1028
|
bins.set(normalizeExportPath(originalSubpath), binFileAbsolutePath);
|
|
1027
1029
|
}
|
|
@@ -1076,7 +1078,7 @@ async function collectSourceEntriesByExportPath(sourceFolderPath, originalSubpat
|
|
|
1076
1078
|
if (isTestFile(dirent.name)) {
|
|
1077
1079
|
continue;
|
|
1078
1080
|
}
|
|
1079
|
-
const sourceFileAbsolutePath = path__default.default.join(
|
|
1081
|
+
const sourceFileAbsolutePath = path__default.default.join(dirPath, dirent.name);
|
|
1080
1082
|
if (isBinaryPath) {
|
|
1081
1083
|
bins.set(originalSubpath, sourceFileAbsolutePath);
|
|
1082
1084
|
} else {
|