bunchee 5.3.1 → 5.3.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # bunchee
2
2
 
3
- > Zero-config bundler for frontend libraries.
3
+ > Zero-config bundler for JS/TS packages.
4
4
 
5
5
  ![bunchee](https://repository-images.githubusercontent.com/154026156/5d132698-0ff5-4644-a4fd-d9570e6229bc)
6
6
 
package/dist/bin/cli.js CHANGED
@@ -470,7 +470,7 @@ function lint$1(pkg) {
470
470
  }
471
471
  }
472
472
 
473
- var version = "5.3.1";
473
+ var version = "5.3.2";
474
474
 
475
475
  function relativify(path) {
476
476
  return path.startsWith('.') ? path : `./${path}`;
package/dist/index.js CHANGED
@@ -1542,7 +1542,7 @@ async function buildOutputConfigs(entry, bundleConfig, exportCondition, buildCon
1542
1542
  const useEsModuleMark = tsCompilerOptions == null ? void 0 : tsCompilerOptions.esModuleInterop // hasEsmExport(exportPaths, tsCompilerOptions)
1543
1543
  ;
1544
1544
  const absoluteOutputFile = path.resolve(cwd, bundleConfig.file);
1545
- const outputFileExtension = path.extname(absoluteOutputFile);
1545
+ const isEsmPkg = isESModulePackage(pkg.type);
1546
1546
  const name = filePathWithoutExtension(absoluteOutputFile);
1547
1547
  var _exportCondition_export_types;
1548
1548
  const dtsFile = path.resolve(cwd, dts ? bundleConfig.file : (_exportCondition_export_types = exportCondition.export.types) != null ? _exportCondition_export_types : getExportFileTypePath(bundleConfig.file));
@@ -1563,7 +1563,8 @@ async function buildOutputConfigs(entry, bundleConfig, exportCondition, buildCon
1563
1563
  sourcemap: bundleConfig.sourcemap,
1564
1564
  manualChunks: createSplitChunks(pluginContext.moduleDirectiveLayerMap, entryFiles),
1565
1565
  chunkFileNames () {
1566
- const ext = format === 'cjs' && outputFileExtension === '.cjs' ? 'cjs' : 'js';
1566
+ const isCjsFormat = format === 'cjs';
1567
+ const ext = dts ? 'd.ts' : isCjsFormat && isEsmPkg ? 'cjs' : !isCjsFormat && !isEsmPkg ? 'mjs' : 'js';
1567
1568
  return '[name]-[hash].' + ext;
1568
1569
  },
1569
1570
  // By default in rollup, when creating multiple chunks, transitive imports of entry chunks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "5.3.1",
3
+ "version": "5.3.2",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",