pkgprn-internal 0.5.3 → 0.5.4
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/index.mjs +8 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -695,7 +695,7 @@ async function prunePkg(pkg, options, logger) {
|
|
|
695
695
|
}
|
|
696
696
|
|
|
697
697
|
if (options.flatten) {
|
|
698
|
-
await flatten(pkg, options.flatten, logger);
|
|
698
|
+
await flatten(pkg, options.flatten, logger, options.removeSourcemaps);
|
|
699
699
|
}
|
|
700
700
|
|
|
701
701
|
if (options.removeSourcemaps) {
|
|
@@ -714,6 +714,11 @@ async function prunePkg(pkg, options, logger) {
|
|
|
714
714
|
|
|
715
715
|
await rm(sourceMap);
|
|
716
716
|
}
|
|
717
|
+
|
|
718
|
+
if (pkg.files && sourceMaps.length > 0) {
|
|
719
|
+
const removedMaps = new Set(sourceMaps.map(f => normalizePath(path.relative('.', f))));
|
|
720
|
+
pkg.files = pkg.files.filter(f => !removedMaps.has(normalizePath(f)));
|
|
721
|
+
}
|
|
717
722
|
}
|
|
718
723
|
|
|
719
724
|
if (options.stripComments) {
|
|
@@ -851,7 +856,7 @@ async function prunePkg(pkg, options, logger) {
|
|
|
851
856
|
}
|
|
852
857
|
}
|
|
853
858
|
|
|
854
|
-
async function flatten(pkg, flatten, logger) {
|
|
859
|
+
async function flatten(pkg, flatten, logger, skipSourcemapAdjust) {
|
|
855
860
|
|
|
856
861
|
const allReferences = extractReferences(pkg);
|
|
857
862
|
|
|
@@ -977,7 +982,7 @@ async function flatten(pkg, flatten, logger) {
|
|
|
977
982
|
|
|
978
983
|
await Promise.all(renamePromises);
|
|
979
984
|
|
|
980
|
-
if (typeof flatten === 'string') {
|
|
985
|
+
if (typeof flatten === 'string' && !skipSourcemapAdjust) {
|
|
981
986
|
|
|
982
987
|
const oldToNew = new Map();
|
|
983
988
|
for (const [newPath, oldPath] of movedFiles) {
|
package/package.json
CHANGED