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