feat(projects): add compress script [添加压缩命令]
This commit is contained in:
parent
61a43b8efd
commit
be6d431485
@ -4,3 +4,5 @@ VITE_COMPRESS=N
|
|||||||
|
|
||||||
# gzip | brotliCompress | deflate | deflateRaw
|
# gzip | brotliCompress | deflate | deflateRaw
|
||||||
VITE_COMPRESS_TYPE=gzip
|
VITE_COMPRESS_TYPE=gzip
|
||||||
|
|
||||||
|
VITE_PWA=N
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ node_modules
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
dist
|
dist
|
||||||
dist-ssr
|
dist-ssr
|
||||||
|
dist.zip
|
||||||
coverage
|
coverage
|
||||||
*.local
|
*.local
|
||||||
stats.html
|
stats.html
|
||||||
|
@ -16,17 +16,7 @@ import pwa from './pwa';
|
|||||||
* @param viteEnv - 环境变量配置
|
* @param viteEnv - 环境变量配置
|
||||||
*/
|
*/
|
||||||
export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | PluginOption[])[] {
|
export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | PluginOption[])[] {
|
||||||
const plugins = [
|
const plugins = [vue(), vueJsx(), html(viteEnv), ...unplugin(viteEnv), unocss(), mock, progress(), routerPage()];
|
||||||
vue(),
|
|
||||||
vueJsx(),
|
|
||||||
html(viteEnv),
|
|
||||||
...unplugin(viteEnv),
|
|
||||||
unocss(),
|
|
||||||
mock,
|
|
||||||
progress(),
|
|
||||||
routerPage(),
|
|
||||||
pwa()
|
|
||||||
];
|
|
||||||
|
|
||||||
if (viteEnv.VITE_VISUALIZER === 'Y') {
|
if (viteEnv.VITE_VISUALIZER === 'Y') {
|
||||||
plugins.push(visualizer as PluginOption);
|
plugins.push(visualizer as PluginOption);
|
||||||
@ -34,6 +24,9 @@ export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | Plugin
|
|||||||
if (viteEnv.VITE_COMPRESS === 'Y') {
|
if (viteEnv.VITE_COMPRESS === 'Y') {
|
||||||
plugins.push(compress(viteEnv));
|
plugins.push(compress(viteEnv));
|
||||||
}
|
}
|
||||||
|
if (viteEnv.VITE_PWA === 'Y' || viteEnv.VITE_VERCEL === 'Y') {
|
||||||
|
plugins.push(pwa());
|
||||||
|
}
|
||||||
|
|
||||||
return plugins;
|
return plugins;
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@
|
|||||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"commit": "czg",
|
"commit": "czg",
|
||||||
"cz": "czg",
|
|
||||||
"esno": "esno",
|
"esno": "esno",
|
||||||
"cleanup": "esno ./scripts/cleanup.ts",
|
"cleanup": "esno ./scripts/cleanup.ts",
|
||||||
|
"compress": "esno ./scripts/compress.ts",
|
||||||
"update-pkg": "ncu --deep -u",
|
"update-pkg": "ncu --deep -u",
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
||||||
"release": "standard-version",
|
"release": "standard-version",
|
||||||
@ -98,6 +98,7 @@
|
|||||||
"@vitejs/plugin-vue": "^3.2.0",
|
"@vitejs/plugin-vue": "^3.2.0",
|
||||||
"@vitejs/plugin-vue-jsx": "^2.1.1",
|
"@vitejs/plugin-vue-jsx": "^2.1.1",
|
||||||
"commitlint": "^17.3.0",
|
"commitlint": "^17.3.0",
|
||||||
|
"compressing": "^1.6.2",
|
||||||
"conventional-changelog": "^3.1.25",
|
"conventional-changelog": "^3.1.25",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cz-git": "^1.4.0",
|
"cz-git": "^1.4.0",
|
||||||
|
120
pnpm-lock.yaml
120
pnpm-lock.yaml
@ -29,6 +29,7 @@ specifiers:
|
|||||||
clipboard: ^2.0.11
|
clipboard: ^2.0.11
|
||||||
colord: ^2.9.3
|
colord: ^2.9.3
|
||||||
commitlint: ^17.3.0
|
commitlint: ^17.3.0
|
||||||
|
compressing: ^1.6.2
|
||||||
conventional-changelog: ^3.1.25
|
conventional-changelog: ^3.1.25
|
||||||
cross-env: ^7.0.3
|
cross-env: ^7.0.3
|
||||||
crypto-js: ^4.1.1
|
crypto-js: ^4.1.1
|
||||||
@ -120,6 +121,7 @@ devDependencies:
|
|||||||
'@vitejs/plugin-vue': 3.2.0_vite@3.2.5+vue@3.2.45
|
'@vitejs/plugin-vue': 3.2.0_vite@3.2.5+vue@3.2.45
|
||||||
'@vitejs/plugin-vue-jsx': 2.1.1_vite@3.2.5+vue@3.2.45
|
'@vitejs/plugin-vue-jsx': 2.1.1_vite@3.2.5+vue@3.2.45
|
||||||
commitlint: 17.3.0
|
commitlint: 17.3.0
|
||||||
|
compressing: 1.6.2
|
||||||
conventional-changelog: 3.1.25
|
conventional-changelog: 3.1.25
|
||||||
cross-env: 7.0.3
|
cross-env: 7.0.3
|
||||||
cz-git: 1.4.0
|
cz-git: 1.4.0
|
||||||
@ -3302,6 +3304,13 @@ packages:
|
|||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/bl/1.2.3:
|
||||||
|
resolution: {integrity: sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==}
|
||||||
|
dependencies:
|
||||||
|
readable-stream: 2.3.7
|
||||||
|
safe-buffer: 5.2.1
|
||||||
|
dev: true
|
||||||
|
|
||||||
/bluebird/3.7.2:
|
/bluebird/3.7.2:
|
||||||
resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==}
|
resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==}
|
||||||
dev: true
|
dev: true
|
||||||
@ -3373,6 +3382,25 @@ packages:
|
|||||||
update-browserslist-db: 1.0.10_browserslist@4.21.4
|
update-browserslist-db: 1.0.10_browserslist@4.21.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/buffer-alloc-unsafe/1.1.0:
|
||||||
|
resolution: {integrity: sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/buffer-alloc/1.2.0:
|
||||||
|
resolution: {integrity: sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==}
|
||||||
|
dependencies:
|
||||||
|
buffer-alloc-unsafe: 1.1.0
|
||||||
|
buffer-fill: 1.0.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/buffer-crc32/0.2.13:
|
||||||
|
resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/buffer-fill/1.0.0:
|
||||||
|
resolution: {integrity: sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/buffer-from/1.1.2:
|
/buffer-from/1.1.2:
|
||||||
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
|
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
|
||||||
dev: true
|
dev: true
|
||||||
@ -3777,6 +3805,21 @@ packages:
|
|||||||
resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==}
|
resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/compressing/1.6.2:
|
||||||
|
resolution: {integrity: sha512-1HK+eK//Tx45n2kuVCl2ITDMZD2JkZAolOYyJrV260lUnq1rPt4d+6L6OvwRFLqAt5aR0vAtGGGiJNmTxqff/g==}
|
||||||
|
engines: {node: '>= 4.0.0'}
|
||||||
|
dependencies:
|
||||||
|
flushwritable: 1.0.0
|
||||||
|
get-ready: 1.0.0
|
||||||
|
iconv-lite: 0.5.2
|
||||||
|
mkdirp: 0.5.6
|
||||||
|
pump: 3.0.0
|
||||||
|
streamifier: 0.1.1
|
||||||
|
tar-stream: 1.6.2
|
||||||
|
yauzl: 2.10.0
|
||||||
|
yazl: 2.5.1
|
||||||
|
dev: true
|
||||||
|
|
||||||
/concat-map/0.0.1:
|
/concat-map/0.0.1:
|
||||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||||
dev: true
|
dev: true
|
||||||
@ -4723,6 +4766,12 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
/end-of-stream/1.4.4:
|
||||||
|
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
|
||||||
|
dependencies:
|
||||||
|
once: 1.4.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
/entities/1.1.2:
|
/entities/1.1.2:
|
||||||
resolution: {integrity: sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==}
|
resolution: {integrity: sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==}
|
||||||
dev: true
|
dev: true
|
||||||
@ -5710,6 +5759,12 @@ packages:
|
|||||||
format: 0.2.2
|
format: 0.2.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/fd-slicer/1.1.0:
|
||||||
|
resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
|
||||||
|
dependencies:
|
||||||
|
pend: 1.2.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
/fecha/4.2.3:
|
/fecha/4.2.3:
|
||||||
resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==}
|
resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==}
|
||||||
dev: false
|
dev: false
|
||||||
@ -5836,6 +5891,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
|
resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/flushwritable/1.0.0:
|
||||||
|
resolution: {integrity: sha512-3VELfuWCLVzt5d2Gblk8qcqFro6nuwvxwMzHaENVDHI7rxcBRtMCwTk/E9FXcgh+82DSpavPNDueA9+RxXJoFg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/follow-redirects/1.15.2:
|
/follow-redirects/1.15.2:
|
||||||
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
|
||||||
engines: {node: '>=4.0'}
|
engines: {node: '>=4.0'}
|
||||||
@ -5893,6 +5952,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==}
|
resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/fs-constants/1.0.0:
|
||||||
|
resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/fs-extra/10.1.0:
|
/fs-extra/10.1.0:
|
||||||
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
|
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@ -6013,6 +6076,10 @@ packages:
|
|||||||
yargs: 16.2.0
|
yargs: 16.2.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/get-ready/1.0.0:
|
||||||
|
resolution: {integrity: sha512-mFXCZPJIlcYcth+N8267+mghfYN9h3EhsDa6JSnbA3Wrhh/XFpuowviFcsDeYZtKspQyWyJqfs4O6P8CHeTwzw==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/get-size/2.0.3:
|
/get-size/2.0.3:
|
||||||
resolution: {integrity: sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q==}
|
resolution: {integrity: sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q==}
|
||||||
dev: false
|
dev: false
|
||||||
@ -6454,6 +6521,13 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
safer-buffer: 2.1.2
|
safer-buffer: 2.1.2
|
||||||
|
|
||||||
|
/iconv-lite/0.5.2:
|
||||||
|
resolution: {integrity: sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag==}
|
||||||
|
engines: {node: '>=0.10.0'}
|
||||||
|
dependencies:
|
||||||
|
safer-buffer: 2.1.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/iconv-lite/0.6.3:
|
/iconv-lite/0.6.3:
|
||||||
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
|
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
@ -8349,6 +8423,10 @@ packages:
|
|||||||
through: 2.3.8
|
through: 2.3.8
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/pend/1.2.0:
|
||||||
|
resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/picocolors/1.0.0:
|
/picocolors/1.0.0:
|
||||||
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
|
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
|
||||||
|
|
||||||
@ -8562,6 +8640,13 @@ packages:
|
|||||||
event-stream: 3.3.4
|
event-stream: 3.3.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/pump/3.0.0:
|
||||||
|
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
|
||||||
|
dependencies:
|
||||||
|
end-of-stream: 1.4.4
|
||||||
|
once: 1.4.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
/punycode/2.1.1:
|
/punycode/2.1.1:
|
||||||
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
|
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -9914,6 +9999,11 @@ packages:
|
|||||||
duplexer: 0.1.2
|
duplexer: 0.1.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/streamifier/0.1.1:
|
||||||
|
resolution: {integrity: sha512-zDgl+muIlWzXNsXeyUfOk9dChMjlpkq0DRsxujtYPgyJ676yQ8jEm6zzaaWHFDg5BNcLuif0eD2MTyJdZqXpdg==}
|
||||||
|
engines: {node: '>=0.10'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/strict-uri-encode/1.1.0:
|
/strict-uri-encode/1.1.0:
|
||||||
resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==}
|
resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
@ -10158,6 +10248,19 @@ packages:
|
|||||||
string-width: 3.1.0
|
string-width: 3.1.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/tar-stream/1.6.2:
|
||||||
|
resolution: {integrity: sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==}
|
||||||
|
engines: {node: '>= 0.8.0'}
|
||||||
|
dependencies:
|
||||||
|
bl: 1.2.3
|
||||||
|
buffer-alloc: 1.2.0
|
||||||
|
end-of-stream: 1.4.4
|
||||||
|
fs-constants: 1.0.0
|
||||||
|
readable-stream: 2.3.7
|
||||||
|
to-buffer: 1.1.1
|
||||||
|
xtend: 4.0.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/tar/6.1.12:
|
/tar/6.1.12:
|
||||||
resolution: {integrity: sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==}
|
resolution: {integrity: sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@ -10233,6 +10336,10 @@ packages:
|
|||||||
os-tmpdir: 1.0.2
|
os-tmpdir: 1.0.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/to-buffer/1.1.1:
|
||||||
|
resolution: {integrity: sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/to-fast-properties/2.0.0:
|
/to-fast-properties/2.0.0:
|
||||||
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
|
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
@ -11589,6 +11696,19 @@ packages:
|
|||||||
yargs-parser: 21.1.1
|
yargs-parser: 21.1.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/yauzl/2.10.0:
|
||||||
|
resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
|
||||||
|
dependencies:
|
||||||
|
buffer-crc32: 0.2.13
|
||||||
|
fd-slicer: 1.1.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/yazl/2.5.1:
|
||||||
|
resolution: {integrity: sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==}
|
||||||
|
dependencies:
|
||||||
|
buffer-crc32: 0.2.13
|
||||||
|
dev: true
|
||||||
|
|
||||||
/yn/3.1.1:
|
/yn/3.1.1:
|
||||||
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
|
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
21
scripts/compress.ts
Normal file
21
scripts/compress.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { createWriteStream } from 'fs';
|
||||||
|
import { zip } from 'compressing';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 压缩目录或者文件
|
||||||
|
* @param paths 目录或者文件的路径
|
||||||
|
* @param destinationName 压缩产物的名称
|
||||||
|
*/
|
||||||
|
function zipDirsOrFile(paths: string[], destinationName = 'dist.zip') {
|
||||||
|
const stream = new zip.Stream();
|
||||||
|
|
||||||
|
paths.forEach(path => {
|
||||||
|
stream.addEntry(path);
|
||||||
|
});
|
||||||
|
|
||||||
|
const destination = createWriteStream(destinationName);
|
||||||
|
|
||||||
|
stream.pipe(destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
zipDirsOrFile(['dist']);
|
2
src/typings/env.d.ts
vendored
2
src/typings/env.d.ts
vendored
@ -53,6 +53,8 @@ interface ImportMetaEnv {
|
|||||||
readonly VITE_COMPRESS?: 'Y' | 'N';
|
readonly VITE_COMPRESS?: 'Y' | 'N';
|
||||||
/** 压缩算法类型 */
|
/** 压缩算法类型 */
|
||||||
readonly VITE_COMPRESS_TYPE?: 'gzip' | 'brotliCompress' | 'deflate' | 'deflateRaw';
|
readonly VITE_COMPRESS_TYPE?: 'gzip' | 'brotliCompress' | 'deflate' | 'deflateRaw';
|
||||||
|
/** 是否应用pwa */
|
||||||
|
readonly VITE_PWA?: 'Y' | 'N';
|
||||||
/** hash路由模式 */
|
/** hash路由模式 */
|
||||||
readonly VITE_HASH_ROUTE?: 'Y' | 'N';
|
readonly VITE_HASH_ROUTE?: 'Y' | 'N';
|
||||||
/** 是否是部署的vercel */
|
/** 是否是部署的vercel */
|
||||||
|
Loading…
Reference in New Issue
Block a user