Reduce vsix file size.
This commit is contained in:
parent
4511fea6fa
commit
2965538991
|
@ -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;
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue