Reduce vsix file size.

This commit is contained in:
CismonX 2021-03-29 01:38:07 +08:00
parent 4511fea6fa
commit 2965538991
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
2 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,17 @@
/**
* Copyright (C) 2021 CismonX <admin@cismon.net>
*
* Copying and distribution of this file, with or without modification, are
* permitted in any medium without royalty, provided the copyright notice and
* this notice are preserved. This file is offered as-is, without any warranty.
*/
// Removes entries from package.json which is not required in the .vsix file,
// so that the file size can be reduced.
delete this._copyrightNotice;
delete this.devDependencies;
delete this.eslintConfig;
delete this.scripts.build;
delete this.scripts.prepare;
delete this.scripts.lint;
delete this.scripts.watch;

View File

@ -13,8 +13,8 @@ for file in ${JSON_FILES[@]}; do
mv $file $file.$BACKUP_SUFFIX
json5 -o $file $file.$BACKUP_SUFFIX
done
json -j0 -I -e 'delete this.eslintConfig; delete this.devDependencies; delete this._copyrightNotice' -f package.json
vsce package --baseContentUrl=`json -f package.json repository.url`
json -j0 -I -e "$(cat ./scripts/package-json-cleanup.js)" -f package.json
vsce package --baseContentUrl=$(json -f package.json repository.url)
for file in ${JSON_FILES[@]}; do
mv $file.$BACKUP_SUFFIX $file
done