Reduce vsix file size.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
CismonX 2021-04-02 16:36:40 +08:00
parent a01f08e618
commit 6417e41d8b
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
2 changed files with 12 additions and 1 deletions

View File

@ -13,8 +13,16 @@ for file in ${JSON_FILES[@]}; do
mv $file $file.$BACKUP_SUFFIX
json5 -o $file $file.$BACKUP_SUFFIX
done
MD_FILES=(README.md CHANGELOG.md)
for file in ${MD_FILES[@]}; do
mv $file $file.$BACKUP_SUFFIX
tail -n +9 $file > $file
done
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
for file in ${MD_FILES[@]}; do
mv $file.$BACKUP_SUFFIX $file
done

View File

@ -8,8 +8,11 @@
import * as path from 'path';
import * as webpack from 'webpack';
import { argv } from 'process';
import TerserPlugin from 'terser-webpack-plugin';
const isProduction = 'production' === argv[argv.indexOf('--mode') + 1];
const config: webpack.Configuration = {
target: 'node',
entry: './src/extension.ts',
@ -19,7 +22,7 @@ const config: webpack.Configuration = {
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]',
},
devtool: 'source-map',
devtool: isProduction ? false : 'source-map',
optimization: {
concatenateModules: true,
minimize: true,