pkgprn-internal 0.5.4 → 0.5.5
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 +6 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -694,6 +694,10 @@ async function prunePkg(pkg, options, logger) {
|
|
|
694
694
|
logger('cleanup is disabled, junk files may cause flatten to fail', 2);
|
|
695
695
|
}
|
|
696
696
|
|
|
697
|
+
if (pkg.files && Array.isArray(pkg.files) && pkg.files.length > 0 && options.cleanupFiles) {
|
|
698
|
+
await cleanupDir(pkg, logger);
|
|
699
|
+
}
|
|
700
|
+
|
|
697
701
|
if (options.flatten) {
|
|
698
702
|
await flatten(pkg, options.flatten, logger, options.removeSourcemaps);
|
|
699
703
|
}
|
|
@@ -851,8 +855,8 @@ async function prunePkg(pkg, options, logger) {
|
|
|
851
855
|
}
|
|
852
856
|
}
|
|
853
857
|
|
|
854
|
-
if (
|
|
855
|
-
|
|
858
|
+
if (options.cleanupFiles) {
|
|
859
|
+
pkg.files = undefined;
|
|
856
860
|
}
|
|
857
861
|
}
|
|
858
862
|
|
|
@@ -1263,8 +1267,6 @@ async function cleanupDir(pkg, logger) {
|
|
|
1263
1267
|
|
|
1264
1268
|
await rm(entry, { recursive: true, force: true });
|
|
1265
1269
|
}
|
|
1266
|
-
|
|
1267
|
-
pkg.files = undefined;
|
|
1268
1270
|
}
|
|
1269
1271
|
|
|
1270
1272
|
async function cleanupSubDir(dir, filesEntries, alwaysIncludedFiles) {
|
package/package.json
CHANGED