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 CHANGED
@@ -27,7 +27,7 @@ var logger = {
27
27
  }
28
28
  };
29
29
 
30
- var version = "2.2.0";
30
+ var version = "2.2.1";
31
31
 
32
32
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
33
33
  try {
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
- entryPath = getSourcePathFromExportPath(config.rootDir, ".");
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": {
6
6
  "bunchee": "./dist/cli.js"