bunchee 4.2.8 → 4.2.10
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 +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -422,7 +422,7 @@ await bundle(path.resolve('./src/index.ts'), {
|
|
|
422
422
|
|
|
423
423
|
#### Watch Mode
|
|
424
424
|
|
|
425
|
-
Bunchee offers a convenient watch mode for rebuilding your library whenever changes are made to the source files. To enable this feature, use either
|
|
425
|
+
Bunchee offers a convenient watch mode for rebuilding your library whenever changes are made to the source files. To enable this feature, use either `-w` or `--watch`.
|
|
426
426
|
|
|
427
427
|
#### `target`
|
|
428
428
|
|
package/dist/bin/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -64,7 +64,8 @@ const disabledWarnings = new Set([
|
|
|
64
64
|
'PREFER_NAMED_EXPORTS',
|
|
65
65
|
'UNRESOLVED_IMPORT',
|
|
66
66
|
'THIS_IS_UNDEFINED',
|
|
67
|
-
'INVALID_ANNOTATION'
|
|
67
|
+
'INVALID_ANNOTATION',
|
|
68
|
+
'UNUSED_EXTERNAL_IMPORT'
|
|
68
69
|
]);
|
|
69
70
|
|
|
70
71
|
function getDefaultExportFromCjs (x) {
|
|
@@ -464,7 +465,7 @@ function findExport(exportPath, exportCondition, paths, packageType, currentPath
|
|
|
464
465
|
} else {
|
|
465
466
|
// subpath is exportType, import, require, ...
|
|
466
467
|
const exportType = subpath;
|
|
467
|
-
const defaultPath = exportCondition[subpath].default;
|
|
468
|
+
const defaultPath = typeof exportCondition[subpath] === 'object' ? exportCondition[subpath].default : exportCondition[subpath];
|
|
468
469
|
const nestedExportCondition = {
|
|
469
470
|
[exportType]: defaultPath
|
|
470
471
|
};
|
|
@@ -805,6 +806,10 @@ async function buildInputConfig(entry, entries, pkg, options, cwd, { tsConfigPat
|
|
|
805
806
|
declarationMap: false,
|
|
806
807
|
skipLibCheck: true,
|
|
807
808
|
target: 'ESNext',
|
|
809
|
+
// Some react types required this to be false by default.
|
|
810
|
+
// Some type package like express might need this as it has other dependencies.
|
|
811
|
+
// Let users able to toggle this in tsconfig.
|
|
812
|
+
preserveSymlinks: 'preserveSymlinks' in tsCompilerOptions ? tsCompilerOptions.preserveSymlinks : false,
|
|
808
813
|
...!tsCompilerOptions.jsx ? {
|
|
809
814
|
jsx: 'react-jsx'
|
|
810
815
|
} : undefined,
|