[Scripts > Strip] Remove as no longer needed

This commit is contained in:
Ducko 2022-01-14 14:08:30 +00:00
parent 11248d1455
commit f94354ccf1
2 changed files with 0 additions and 21 deletions

View File

@ -26,7 +26,6 @@ jobs:
- name: Pack base asar
run: |
npm i -g asar uglify-js
node scripts/strip.js
node scripts/injectPolyfills.js
sed -i -e "s/nightly/nightly-$(git rev-parse HEAD | cut -c 1-7)/" src/index.js

View File

@ -1,20 +0,0 @@
const { execSync } = require('child_process');
const { readdirSync } = require('fs');
const { join } = require('path');
// Strip unneeded files in node deps
execSync(`rm -rf src/package-lock.json src/node_modules/.package-lock.json src/node_modules/**/package.json src/node_modules/**/*.md src/node_modules/**/.*.yml src/node_modules/**/.npmignore src/node_modules/**/LICENSE src/node_modules/**/test*`);
// Minify node deps code
for (const package of readdirSync('src/node_modules')) {
let indexPath;
if (package.endsWith('.js')) {
indexPath = join('src/node_modules', package);
} else {
indexPath = join('src/node_modules', package, 'index.js');
}
console.log(package, indexPath);
execSync(`npx uglifyjs --compress --mangle -o ${indexPath} -- ${indexPath}`);
}