bunchee 6.4.0 → 6.5.0
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 +8 -5
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -646,7 +646,7 @@ function lint$1(pkg) {
|
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
-
var version = "6.
|
|
649
|
+
var version = "6.5.0";
|
|
650
650
|
|
|
651
651
|
async function writeDefaultTsconfig(tsConfigPath) {
|
|
652
652
|
await fs.promises.writeFile(tsConfigPath, JSON.stringify(DEFAULT_TS_CONFIG, null, 2), 'utf-8');
|
|
@@ -973,14 +973,17 @@ async function prepare(cwd) {
|
|
|
973
973
|
} else {
|
|
974
974
|
// Update existing exports
|
|
975
975
|
Object.keys(pkgExports).forEach((exportName)=>{
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
976
|
+
pkgJson.exports[exportName] = {
|
|
977
|
+
// Apply the new export conditions
|
|
978
|
+
...pkgJson.exports[exportName],
|
|
979
|
+
// Keep the existing export conditions
|
|
980
|
+
...pkgJson.exports[exportName]
|
|
981
|
+
};
|
|
979
982
|
});
|
|
980
983
|
}
|
|
981
984
|
}
|
|
982
985
|
}
|
|
983
|
-
await fsp__default.default.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
|
|
986
|
+
await fsp__default.default.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + '\n');
|
|
984
987
|
logger.info('Configured `exports` in package.json');
|
|
985
988
|
}
|
|
986
989
|
|
package/dist/index.js
CHANGED
|
@@ -1507,7 +1507,7 @@ async function buildInputConfig(entry, bundleConfig, exportCondition, buildConte
|
|
|
1507
1507
|
target: jscTarget
|
|
1508
1508
|
},
|
|
1509
1509
|
loose: true,
|
|
1510
|
-
externalHelpers:
|
|
1510
|
+
externalHelpers: true,
|
|
1511
1511
|
parser: swcParserConfig,
|
|
1512
1512
|
transform: {
|
|
1513
1513
|
decoratorVersion: '2022-03'
|
|
@@ -1641,6 +1641,10 @@ function createSplitChunks(dependencyGraphMap, entryFiles) {
|
|
|
1641
1641
|
// If there's existing chunk being splitted, and contains a layer { <id>: <chunkGroup> }
|
|
1642
1642
|
const splitChunksGroupMap = new Map();
|
|
1643
1643
|
return function splitChunks(id, ctx) {
|
|
1644
|
+
if (/[\\/]node_modules[\\/]\@swc[\\/]helper/.test(id)) {
|
|
1645
|
+
return 'cc' // common chunk
|
|
1646
|
+
;
|
|
1647
|
+
}
|
|
1644
1648
|
const moduleInfo = ctx.getModuleInfo(id);
|
|
1645
1649
|
if (!moduleInfo) {
|
|
1646
1650
|
return;
|