bunchee 4.4.7 → 4.4.8

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
@@ -558,7 +558,7 @@ function lint$1(pkg) {
558
558
  }
559
559
  }
560
560
 
561
- var version = "4.4.7";
561
+ var version = "4.4.8";
562
562
 
563
563
  function relativify(path) {
564
564
  return path.startsWith('.') ? path : `./${path}`;
package/dist/index.js CHANGED
@@ -937,7 +937,7 @@ function getDefinedInlineVariables(envs, parsedExportCondition) {
937
937
  return alias;
938
938
  }
939
939
  async function buildInputConfig(entry, bundleConfig, exportCondition, buildContext, dts) {
940
- var _bundleConfig_file;
940
+ var _bundleConfig_file, _bundleConfig_file1;
941
941
  const { entries, pkg, cwd, tsOptions: { tsConfigPath, tsCompilerOptions }, pluginContext } = buildContext;
942
942
  const hasNoExternal = bundleConfig.external === null;
943
943
  var _bundleConfig_external;
@@ -983,7 +983,8 @@ async function buildInputConfig(entry, bundleConfig, exportCondition, buildConte
983
983
  };
984
984
  const sizePlugin = pluginContext.outputState.plugin(cwd);
985
985
  // common plugins for both dts and ts assets that need to be processed
986
- const aliasFormat = dts ? ((_bundleConfig_file = bundleConfig.file) == null ? void 0 : _bundleConfig_file.endsWith('.d.cts')) ? 'cjs' : 'esm' : bundleConfig.format;
986
+ // If it's a .d.ts file under non-ESM package or .d.cts file, use cjs types alias.
987
+ const aliasFormat = dts ? ((_bundleConfig_file = bundleConfig.file) == null ? void 0 : _bundleConfig_file.endsWith('.d.cts')) || ((_bundleConfig_file1 = bundleConfig.file) == null ? void 0 : _bundleConfig_file1.endsWith('.d.ts')) && !isESModulePackage(pkg.type) ? 'cjs' : 'esm' : bundleConfig.format;
987
988
  const commonPlugins = [
988
989
  json__default.default(),
989
990
  sizePlugin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "4.4.7",
3
+ "version": "4.4.8",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",