npm-pkgbuild 18.3.1 → 18.3.2
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 +1 -1
- package/src/npm-pkgbuild-cli.mjs +10 -6
- package/src/npm-shrink.mjs +5 -3
package/package.json
CHANGED
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -115,15 +115,19 @@ program
|
|
|
115
115
|
const proc = await execa("file", ["-b", entry.filename], {
|
|
116
116
|
cwd: options.dir
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
const parts = proc.stdout.split(/\s*,\s*/);
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
if(!parts[4].match(/Android/i)) {
|
|
121
|
+
let arch = parts[1];
|
|
122
|
+
|
|
123
|
+
const archs = { "ARM aarch64" : "aarch64" };
|
|
124
|
+
arch = archs[arch] || arch;
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
if(properties.arch.indexOf(arch) >= 0) {
|
|
127
|
+
return entry;
|
|
128
|
+
}
|
|
125
129
|
}
|
|
126
|
-
|
|
130
|
+
|
|
127
131
|
console.log("skip", entry.filename);
|
|
128
132
|
}
|
|
129
133
|
},
|
package/src/npm-shrink.mjs
CHANGED
|
@@ -102,14 +102,16 @@ export function shrinkNPM(
|
|
|
102
102
|
"xo"
|
|
103
103
|
];
|
|
104
104
|
|
|
105
|
-
toBeRemoved.map(key => delete pkg[key]);
|
|
106
|
-
|
|
107
105
|
if (options?.removeKeys) {
|
|
108
106
|
options.removeKeys.map(key => {
|
|
109
|
-
|
|
107
|
+
if (pkg.addon && key !== "name") {
|
|
108
|
+
delete pkg[key];
|
|
109
|
+
}
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
toBeRemoved.map(key => delete pkg[key]);
|
|
114
|
+
|
|
113
115
|
if (options.removeDefaults) {
|
|
114
116
|
switch (pkg.main) {
|
|
115
117
|
case "index":
|