feat: 添加构建大小计算步骤;更新依赖项,新增 vite-plugin-singlefile 插件
This commit is contained in:
11
.github/workflows/playwright.yaml
vendored
11
.github/workflows/playwright.yaml
vendored
@ -1,10 +1,13 @@
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
TZ: Asia/Shanghai
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
surge:
|
||||
runs-on: ubuntu-latest
|
||||
@ -15,6 +18,14 @@ jobs:
|
||||
- run: pnpm run build-only
|
||||
env:
|
||||
VITE_BUILD_COMMIT: ${{ github.sha }}
|
||||
- name: 计算构建大小
|
||||
working-directory: dist
|
||||
run: |
|
||||
set -x
|
||||
du -sk . | cut -f1 # 以千字节(KB)为单位
|
||||
du -sm . | cut -f1 # 以兆字节(MB)为单位
|
||||
du -s --si . | cut -f1 # 使用SI单位(基于1000而非1024)
|
||||
du -sh . | cut -f1 # 以人类可读的方式
|
||||
- name: 部署到 Surge
|
||||
id: surge_deploy
|
||||
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps
|
||||
|
@ -127,6 +127,7 @@
|
||||
"vite": "^6.1.0",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-fake-server": "^2.2.0",
|
||||
"vite-plugin-singlefile": "^2.2.0",
|
||||
"vite-plugin-static-copy": "^2.3.0",
|
||||
"vite-plugin-vue-devtools": "^7.7.1",
|
||||
"vite-plugin-vue-layouts": "^0.11.0",
|
||||
|
44
pnpm-lock.yaml
generated
44
pnpm-lock.yaml
generated
@ -272,6 +272,9 @@ importers:
|
||||
vite-plugin-fake-server:
|
||||
specifier: ^2.2.0
|
||||
version: 2.2.0
|
||||
vite-plugin-singlefile:
|
||||
specifier: ^2.2.0
|
||||
version: 2.2.0(rollup@4.30.1)(vite@6.1.0(@types/node@22.13.10)(jiti@2.4.2)(less@4.2.2)(sass-embedded@1.83.4)(terser@5.38.2)(tsx@4.19.2)(yaml@2.7.0))
|
||||
vite-plugin-static-copy:
|
||||
specifier: ^2.3.0
|
||||
version: 2.3.0(vite@6.1.0(@types/node@22.13.10)(jiti@2.4.2)(less@4.2.2)(sass-embedded@1.83.4)(terser@5.38.2)(tsx@4.19.2)(yaml@2.7.0))
|
||||
@ -948,16 +951,12 @@ packages:
|
||||
resolution: {integrity: sha512-bb8gZvoeKExCI2r/NVCK9E4YyOkvYGaSCPxVZe8T0jz8aX+dHEOZWxK06Z/Y9mWRkJfBiCH4aOhDF1yr1t5J8Q==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/message-compiler@11.0.0-rc.1':
|
||||
resolution: {integrity: sha512-TGw2uBfuTFTegZf/BHtUQBEKxl7Q/dVGLoqRIdw8lFsp9g/53sYn5iD+0HxIzdYjbWL6BTJMXCPUHp9PxDTRPw==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/message-compiler@11.1.1':
|
||||
resolution: {integrity: sha512-4iEsUZ3aF7jXY19CJFN5VP+pPyLITD9FVsjB13z9TU1UxaZLlFsmNhvRxlPDSOfHAP5RpNF2QKKdZ3DHVf4Yzw==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/shared@11.0.0-rc.1':
|
||||
resolution: {integrity: sha512-8tR1xe7ZEbkabTuE/tNhzpolygUn9OaYp9yuYAF4MgDNZg06C3Qny80bes2/e9/Wm3aVkPUlCw6WgU7mQd0yEg==}
|
||||
'@intlify/message-compiler@12.0.0-alpha.2':
|
||||
resolution: {integrity: sha512-PD9C+oQbb7BF52hec0+vLnScaFkvnfX+R7zSbODYuRo/E2niAtGmHd0wPvEMsDhf9Z9b8f/qyDsVeZnD/ya9Ug==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/shared@11.1.1':
|
||||
@ -968,6 +967,10 @@ packages:
|
||||
resolution: {integrity: sha512-dF2iMMy8P9uKVHV/20LA1ulFLL+MKSbfMiixSmn6fpwqzvix38OIc7ebgnFbBqElvghZCW9ACtzKTGKsTGTWGA==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/shared@12.0.0-alpha.2':
|
||||
resolution: {integrity: sha512-P2DULVX9nz3y8zKNqLw9Es1aAgQ1JGC+kgpx5q7yLmrnAKkPR5MybQWoEhxanefNJgUY5ehsgo+GKif59SrncA==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@intlify/unplugin-vue-i18n@6.0.3':
|
||||
resolution: {integrity: sha512-9ZDjBlhUHtgjRl23TVcgfJttgu8cNepwVhWvOv3mUMRDAhjW0pur1mWKEUKr1I8PNwE4Gvv2IQ1xcl4RL0nG0g==}
|
||||
engines: {node: '>= 18'}
|
||||
@ -5397,6 +5400,13 @@ packages:
|
||||
'@nuxt/kit':
|
||||
optional: true
|
||||
|
||||
vite-plugin-singlefile@2.2.0:
|
||||
resolution: {integrity: sha512-Ik1wXmJaGzeQtUeIV7JprDUqqy6DlLzXAY27Blei5peE4c9VJF+Kp9xWDJeuX0RJUZmFbIAuw1/RAh06A+Ql7w==}
|
||||
engines: {node: '>18.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^4.35.0
|
||||
vite: ^6.1.0
|
||||
|
||||
vite-plugin-static-copy@2.3.0:
|
||||
resolution: {integrity: sha512-LLKwhhHetGaCnWz4mas4qqjjguDka6/6b4+SeIohRroj8aCE7QTfiZECfPecslFQkWZ3HdQuq5kOPmWZjNYlKA==}
|
||||
engines: {node: ^18.0.0 || >=20.0.0}
|
||||
@ -6236,8 +6246,8 @@ snapshots:
|
||||
|
||||
'@intlify/bundle-utils@10.0.0(vue-i18n@11.1.1(vue@3.5.13(typescript@5.8.2)))':
|
||||
dependencies:
|
||||
'@intlify/message-compiler': 11.0.0-rc.1
|
||||
'@intlify/shared': 11.0.0-rc.1
|
||||
'@intlify/message-compiler': 12.0.0-alpha.2
|
||||
'@intlify/shared': 12.0.0-alpha.2
|
||||
acorn: 8.14.0
|
||||
escodegen: 2.1.0
|
||||
estree-walker: 2.0.2
|
||||
@ -6253,22 +6263,22 @@ snapshots:
|
||||
'@intlify/message-compiler': 11.1.1
|
||||
'@intlify/shared': 11.1.1
|
||||
|
||||
'@intlify/message-compiler@11.0.0-rc.1':
|
||||
dependencies:
|
||||
'@intlify/shared': 11.0.0-rc.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@intlify/message-compiler@11.1.1':
|
||||
dependencies:
|
||||
'@intlify/shared': 11.1.1
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@intlify/shared@11.0.0-rc.1': {}
|
||||
'@intlify/message-compiler@12.0.0-alpha.2':
|
||||
dependencies:
|
||||
'@intlify/shared': 12.0.0-alpha.2
|
||||
source-map-js: 1.2.1
|
||||
|
||||
'@intlify/shared@11.1.1': {}
|
||||
|
||||
'@intlify/shared@11.1.2': {}
|
||||
|
||||
'@intlify/shared@12.0.0-alpha.2': {}
|
||||
|
||||
'@intlify/unplugin-vue-i18n@6.0.3(@vue/compiler-dom@3.5.13)(eslint@9.20.1(jiti@2.4.2))(rollup@4.30.1)(typescript@5.8.2)(vue-i18n@11.1.1(vue@3.5.13(typescript@5.8.2)))(vue@3.5.13(typescript@5.8.2))':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.4.1(eslint@9.20.1(jiti@2.4.2))
|
||||
@ -11130,6 +11140,12 @@ snapshots:
|
||||
- rollup
|
||||
- supports-color
|
||||
|
||||
vite-plugin-singlefile@2.2.0(rollup@4.30.1)(vite@6.1.0(@types/node@22.13.10)(jiti@2.4.2)(less@4.2.2)(sass-embedded@1.83.4)(terser@5.38.2)(tsx@4.19.2)(yaml@2.7.0)):
|
||||
dependencies:
|
||||
micromatch: 4.0.8
|
||||
rollup: 4.30.1
|
||||
vite: 6.1.0(@types/node@22.13.10)(jiti@2.4.2)(less@4.2.2)(sass-embedded@1.83.4)(terser@5.38.2)(tsx@4.19.2)(yaml@2.7.0)
|
||||
|
||||
vite-plugin-static-copy@2.3.0(vite@6.1.0(@types/node@22.13.10)(jiti@2.4.2)(less@4.2.2)(sass-embedded@1.83.4)(terser@5.38.2)(tsx@4.19.2)(yaml@2.7.0)):
|
||||
dependencies:
|
||||
chokidar: 3.6.0
|
||||
|
@ -25,6 +25,7 @@ import { createUtils4uAutoImports } from 'utils4u/auto-imports';
|
||||
import { PluginOption } from 'vite';
|
||||
import cdnImport from 'vite-plugin-cdn-import';
|
||||
import { vitePluginFakeServer } from 'vite-plugin-fake-server';
|
||||
import { viteSingleFile } from 'vite-plugin-singlefile';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import VueDevTools from 'vite-plugin-vue-devtools';
|
||||
import MetaLayouts from 'vite-plugin-vue-meta-layouts';
|
||||
@ -173,6 +174,7 @@ export function Plugins() {
|
||||
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
// globalThis.CESIUM_BASE_URL = 'https://digitalarsenal.io/';
|
||||
{ dest: cesiumBaseUrl, src: `${cesiumSource}/ThirdParty` },
|
||||
{ dest: cesiumBaseUrl, src: `${cesiumSource}/Workers` },
|
||||
{ dest: cesiumBaseUrl, src: `${cesiumSource}/Assets` },
|
||||
@ -196,6 +198,8 @@ export function Plugins() {
|
||||
modules: ['vue'],
|
||||
prodUrl: '//fastly.jsdelivr.net/npm/{name}@{version}/{path}',
|
||||
}),
|
||||
|
||||
viteSingleFile(),
|
||||
);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user