bunchee 4.4.5 → 4.4.6
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 -4
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -481,13 +481,13 @@ function lint$1(pkg) {
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
} else {
|
|
484
|
+
// Validate CJS package
|
|
484
485
|
if (main && path__default.default.extname(main) === '.mjs') {
|
|
485
486
|
state.badMainExtension = true;
|
|
486
487
|
}
|
|
487
|
-
// Validate CJS package
|
|
488
488
|
if (exports) {
|
|
489
489
|
if (typeof exports === 'string') {
|
|
490
|
-
if (
|
|
490
|
+
if (path__default.default.extname(exports) === '.mjs') {
|
|
491
491
|
state.badMainExport = true;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -523,7 +523,11 @@ function lint$1(pkg) {
|
|
|
523
523
|
logger.warn('Cannot export `main` field with .mjs extension in CJS package, only .js extension is allowed');
|
|
524
524
|
}
|
|
525
525
|
if (state.badMainExport) {
|
|
526
|
-
|
|
526
|
+
if (isESM) {
|
|
527
|
+
logger.warn('Cannot export `exports` field with .cjs extension in ESM package, only .mjs and .js extensions are allowed');
|
|
528
|
+
} else {
|
|
529
|
+
logger.warn('Cannot export `exports` field with .mjs extension in CJS package, only .js and .cjs extensions are allowed');
|
|
530
|
+
}
|
|
527
531
|
}
|
|
528
532
|
if (state.invalidExportsFieldType) {
|
|
529
533
|
logger.warn('Invalid exports field type, only object or string is allowed');
|
|
@@ -554,7 +558,7 @@ function lint$1(pkg) {
|
|
|
554
558
|
}
|
|
555
559
|
}
|
|
556
560
|
|
|
557
|
-
var version = "4.4.
|
|
561
|
+
var version = "4.4.6";
|
|
558
562
|
|
|
559
563
|
function relativify(path) {
|
|
560
564
|
return path.startsWith('.') ? path : `./${path}`;
|
package/dist/index.js
CHANGED
|
@@ -1017,6 +1017,9 @@ async function buildInputConfig(entry, bundleConfig, exportCondition, buildConte
|
|
|
1017
1017
|
checkJs: false,
|
|
1018
1018
|
declarationMap: false,
|
|
1019
1019
|
skipLibCheck: true,
|
|
1020
|
+
// preserveSymlinks should always be set to false to avoid issues with
|
|
1021
|
+
// resolving types from <reference> from node_modules
|
|
1022
|
+
preserveSymlinks: false,
|
|
1020
1023
|
target: 'ESNext',
|
|
1021
1024
|
...!tsCompilerOptions.jsx ? {
|
|
1022
1025
|
jsx: 'react-jsx'
|
|
@@ -1698,11 +1701,12 @@ function logWatcherBuildTime(result) {
|
|
|
1698
1701
|
let startTime = 0;
|
|
1699
1702
|
result.map((watcher)=>{
|
|
1700
1703
|
function start() {
|
|
1701
|
-
if (
|
|
1704
|
+
if (watcherCounter === 0) startTime = perf_hooks.performance.now();
|
|
1705
|
+
watcherCounter++;
|
|
1702
1706
|
}
|
|
1703
1707
|
function end() {
|
|
1704
|
-
watcherCounter
|
|
1705
|
-
if (watcherCounter ===
|
|
1708
|
+
watcherCounter--;
|
|
1709
|
+
if (watcherCounter === 0) {
|
|
1706
1710
|
logger.info(`Build in ${(perf_hooks.performance.now() - startTime).toFixed(2)}ms`);
|
|
1707
1711
|
}
|
|
1708
1712
|
}
|