bunchee 4.4.6 → 4.4.7

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.6";
561
+ var version = "4.4.7";
562
562
 
563
563
  function relativify(path) {
564
564
  return path.startsWith('.') ? path : `./${path}`;
package/dist/index.js CHANGED
@@ -1179,6 +1179,7 @@ async function buildOutputConfigs(entry, bundleConfig, exportCondition, buildCon
1179
1179
  // Add esm mark and interop helper if esm export is detected
1180
1180
  const useEsModuleMark = hasEsmExport(exportPaths, tsCompilerOptions);
1181
1181
  const absoluteOutputFile = path.resolve(cwd, bundleConfig.file);
1182
+ const outputFileExtension = path.extname(absoluteOutputFile);
1182
1183
  const name = filePathWithoutExtension(absoluteOutputFile);
1183
1184
  var _exportCondition_export_types;
1184
1185
  const dtsFile = path.resolve(cwd, dts ? bundleConfig.file : (_exportCondition_export_types = exportCondition.export.types) != null ? _exportCondition_export_types : getExportFileTypePath(bundleConfig.file));
@@ -1198,7 +1199,10 @@ async function buildOutputConfigs(entry, bundleConfig, exportCondition, buildCon
1198
1199
  strict: false,
1199
1200
  sourcemap: bundleConfig.sourcemap,
1200
1201
  manualChunks: createSplitChunks(pluginContext.moduleDirectiveLayerMap, entryFiles),
1201
- chunkFileNames: '[name]-[hash].js',
1202
+ chunkFileNames () {
1203
+ const ext = format === 'cjs' && outputFileExtension === '.cjs' ? 'cjs' : 'js';
1204
+ return '[name]-[hash].' + ext;
1205
+ },
1202
1206
  // By default in rollup, when creating multiple chunks, transitive imports of entry chunks
1203
1207
  // will be added as empty imports to the entry chunks. Disable to avoid imports hoist outside of boundaries
1204
1208
  hoistTransitiveImports: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunchee",
3
- "version": "4.4.6",
3
+ "version": "4.4.7",
4
4
  "description": "zero config bundler for js/ts/jsx libraries",
5
5
  "bin": "./dist/bin/cli.js",
6
6
  "main": "./dist/index.js",