@pezkuwi/dev 0.85.6 → 0.85.7
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/package.json
CHANGED
|
@@ -788,11 +788,14 @@ function buildExports () {
|
|
|
788
788
|
}
|
|
789
789
|
|
|
790
790
|
if (pkg.main) {
|
|
791
|
-
|
|
791
|
+
let main = pkg.main.startsWith('./')
|
|
792
792
|
? pkg.main
|
|
793
793
|
: `./${pkg.main}`;
|
|
794
794
|
|
|
795
|
-
//
|
|
795
|
+
// Strip ./build/ prefix if present (source package.json may have ./build/cjs/index.js)
|
|
796
|
+
main = main.replace(/^\.\/build\//, './');
|
|
797
|
+
|
|
798
|
+
// Add ./cjs/ prefix if not already present (for CJS entry point)
|
|
796
799
|
pkg.main = main.startsWith('./cjs/') ? main : main.replace(/^\.\//, './cjs/');
|
|
797
800
|
pkg.module = main;
|
|
798
801
|
pkg.types = main.replace('.js', '.d.ts');
|
|
@@ -803,11 +806,14 @@ function buildExports () {
|
|
|
803
806
|
const value = pkg[k];
|
|
804
807
|
|
|
805
808
|
if (typeof value === 'string') {
|
|
806
|
-
|
|
809
|
+
let entry = value.startsWith('./')
|
|
807
810
|
? value
|
|
808
811
|
: `./${value}`;
|
|
809
812
|
|
|
810
|
-
//
|
|
813
|
+
// Strip ./build/ prefix if present
|
|
814
|
+
entry = entry.replace(/^\.\/build\//, './');
|
|
815
|
+
|
|
816
|
+
// Add ./cjs/ prefix if not already present
|
|
811
817
|
pkg[k] = entry.startsWith('./cjs/') ? entry : entry.replace(/^\.\//, './cjs/');
|
|
812
818
|
}
|
|
813
819
|
});
|