bunchee 2.2.0 → 2.2.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.
- package/dist/cli.js +1 -1
- package/dist/lib.js +4 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/lib.js
CHANGED
|
@@ -601,6 +601,7 @@ function assignDefault(options, name, defaultValue) {
|
|
|
601
601
|
}
|
|
602
602
|
// Map '.' -> './index.[ext]'
|
|
603
603
|
// Map './lite' -> './lite.[ext]'
|
|
604
|
+
// Return undefined if no match or if it's package.json exports
|
|
604
605
|
function getSourcePathFromExportPath(cwd, exportPath) {
|
|
605
606
|
var exts = [
|
|
606
607
|
"js",
|
|
@@ -665,7 +666,9 @@ function _bundle() {
|
|
|
665
666
|
isSingleEntry = typeof packageExports === "string";
|
|
666
667
|
hasMultiEntries = packageExports && !isSingleEntry && Object.keys(packageExports).length > 0;
|
|
667
668
|
if (isSingleEntry) {
|
|
668
|
-
|
|
669
|
+
// Use specified string file path if possible, then fallback to the default behavior entry picking logic
|
|
670
|
+
// e.g. "exports": "./dist/index.js" -> use "./index.<ext>" as entry
|
|
671
|
+
entryPath = entryPath || getSourcePathFromExportPath(config.rootDir, ".") || "";
|
|
669
672
|
}
|
|
670
673
|
bundleOrWatch = function(rollupConfig) {
|
|
671
674
|
var input = rollupConfig.input, exportName = rollupConfig.exportName;
|