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 +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/bin/cli.js
CHANGED
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
|
|
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
|
|
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
|