2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 03:07:20 +08:00

feat: 本地加载monaco编辑器以及去掉无用的插件

This commit is contained in:
耗子
2024-09-29 01:56:50 +08:00
parent d4feba17d0
commit 4ad7ec58be
9 changed files with 50 additions and 201 deletions

View File

@@ -8,13 +8,3 @@ VITE_USE_HASH = false
# base api
VITE_BASE_API = '/api'
# 是否启用压缩
VITE_USE_COMPRESS = false
# 压缩类型
VITE_COMPRESS_TYPE = gzip

12
web/build/plugins/copy.ts Normal file
View File

@@ -0,0 +1,12 @@
import { viteStaticCopy } from 'vite-plugin-static-copy'
export function setupStaticCopyPlugin() {
return viteStaticCopy({
targets: [
{
src: 'node_modules/monaco-editor/min/vs',
dest: 'assets'
}
]
})
}

View File

@@ -2,8 +2,7 @@ import { createHtmlPlugin } from 'vite-plugin-html'
export function setupHtmlPlugin(viteEnv: ViteEnv) {
const { VITE_APP_TITLE } = viteEnv
const htmlPlugin = createHtmlPlugin({
return createHtmlPlugin({
minify: true,
inject: {
data: {
@@ -12,5 +11,4 @@ export function setupHtmlPlugin(viteEnv: ViteEnv) {
},
viteNext: true
})
return htmlPlugin
}

View File

@@ -1,28 +1,11 @@
import type { PluginOption } from 'vite'
import vue from '@vitejs/plugin-vue'
import unocss from 'unocss/vite'
import { visualizer } from 'rollup-plugin-visualizer'
import viteCompression from 'vite-plugin-compression'
import unplugins from './unplugin'
import { setupHtmlPlugin } from './html'
import { setupStaticCopyPlugin } from './copy'
export function setupVitePlugins(viteEnv: ViteEnv, isBuild: boolean): PluginOption[] {
const plugins = [vue(), ...unplugins, unocss(), setupHtmlPlugin(viteEnv)]
if (viteEnv.VITE_USE_COMPRESS) {
plugins.push(viteCompression({ algorithm: viteEnv.VITE_COMPRESS_TYPE || 'gzip' }))
}
if (isBuild) {
plugins.push(
visualizer({
open: true,
gzipSize: true,
brotliSize: true
})
)
}
return plugins
export function setupVitePlugins(viteEnv: ViteEnv): PluginOption[] {
return [vue(), ...unplugins, unocss(), setupStaticCopyPlugin(), setupHtmlPlugin(viteEnv)]
}

View File

@@ -52,10 +52,10 @@
"colord": "^2.9.3",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.28.0",
"monaco-editor": "^0.52.0",
"naive-ui": "^2.39.0",
"npm-run-all2": "^6.2.3",
"prettier": "^3.3.3",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.78.0",
"typescript": "^5.5.4",
"unocss": "^0.63.0",
@@ -63,9 +63,9 @@
"unplugin-icons": "^0.19.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.5",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.2",
"vite-plugin-mock": "^3.0.2",
"vite-plugin-static-copy": "^1.0.6",
"vue-tsc": "^2.1.6"
}
}

191
web/pnpm-lock.yaml generated
View File

@@ -99,6 +99,9 @@ importers:
eslint-plugin-vue:
specifier: ^9.28.0
version: 9.28.0(eslint@8.57.1)
monaco-editor:
specifier: ^0.52.0
version: 0.52.0
naive-ui:
specifier: ^2.39.0
version: 2.40.1(vue@3.5.10(typescript@5.6.2))
@@ -108,9 +111,6 @@ importers:
prettier:
specifier: ^3.3.3
version: 3.3.3
rollup-plugin-visualizer:
specifier: ^5.12.0
version: 5.12.0(rollup@4.22.4)
sass:
specifier: ^1.78.0
version: 1.79.4
@@ -132,15 +132,15 @@ importers:
vite:
specifier: ^5.4.5
version: 5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0)
vite-plugin-compression:
specifier: ^0.5.1
version: 0.5.1(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0))
vite-plugin-html:
specifier: ^3.2.2
version: 3.2.2(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0))
vite-plugin-mock:
specifier: ^3.0.2
version: 3.0.2(esbuild@0.23.1)(mockjs@1.1.0)(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0))
vite-plugin-static-copy:
specifier: ^1.0.6
version: 1.0.6(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0))
vue-tsc:
specifier: ^2.1.6
version: 2.1.6(typescript@5.6.2)
@@ -1098,10 +1098,6 @@ packages:
resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==}
engines: {node: '>= 10.0'}
cliui@8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
@@ -1220,10 +1216,6 @@ packages:
deep-is@0.1.4:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
define-lazy-prop@2.0.0:
resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
engines: {node: '>=8'}
defu@6.1.4:
resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==}
@@ -1280,9 +1272,6 @@ packages:
engines: {node: '>=0.10.0'}
hasBin: true
emoji-regex@8.0.0:
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
encodeurl@1.0.2:
resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==}
engines: {node: '>= 0.8'}
@@ -1304,10 +1293,6 @@ packages:
engines: {node: '>=18'}
hasBin: true
escalade@3.2.0:
resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
engines: {node: '>=6'}
escape-html@1.0.3:
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
@@ -1457,6 +1442,10 @@ packages:
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
engines: {node: '>=12'}
fs-extra@11.2.0:
resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==}
engines: {node: '>=14.14'}
fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
@@ -1465,10 +1454,6 @@ packages:
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
get-caller-file@2.0.5:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
get-tsconfig@4.8.1:
resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==}
@@ -1552,19 +1537,10 @@ packages:
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
engines: {node: '>=8'}
is-docker@2.2.1:
resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}
engines: {node: '>=8'}
hasBin: true
is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
is-fullwidth-code-point@3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
engines: {node: '>=8'}
is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
@@ -1577,10 +1553,6 @@ packages:
resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
engines: {node: '>=8'}
is-wsl@2.2.0:
resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==}
engines: {node: '>=8'}
isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
@@ -1758,10 +1730,6 @@ packages:
once@1.4.0:
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
open@8.4.2:
resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
engines: {node: '>=12'}
optionator@0.9.4:
resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
engines: {node: '>= 0.8.0'}
@@ -1900,10 +1868,6 @@ packages:
resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==}
engines: {node: '>= 0.10'}
require-directory@2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
resolve-from@4.0.0:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
@@ -1920,16 +1884,6 @@ packages:
deprecated: Rimraf versions prior to v4 are no longer supported
hasBin: true
rollup-plugin-visualizer@5.12.0:
resolution: {integrity: sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==}
engines: {node: '>=14'}
hasBin: true
peerDependencies:
rollup: 2.x || 3.x || 4.x
peerDependenciesMeta:
rollup:
optional: true
rollup@4.22.4:
resolution: {integrity: sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@@ -1984,10 +1938,6 @@ packages:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
source-map@0.7.4:
resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==}
engines: {node: '>= 8'}
state-local@1.0.7:
resolution: {integrity: sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==}
@@ -1995,10 +1945,6 @@ packages:
resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==}
engines: {node: '>= 0.6'}
string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
@@ -2179,11 +2125,6 @@ packages:
peerDependencies:
vue: ^3.0.11
vite-plugin-compression@0.5.1:
resolution: {integrity: sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==}
peerDependencies:
vite: '>=2.0.0'
vite-plugin-html@3.2.2:
resolution: {integrity: sha512-vb9C9kcdzcIo/Oc3CLZVS03dL5pDlOFuhGlZYDCJ840BhWl/0nGeZWf3Qy7NlOayscY4Cm/QRgULCQkEZige5Q==}
peerDependencies:
@@ -2197,6 +2138,12 @@ packages:
mockjs: '>=1.1.0'
vite: '>=4.0.0'
vite-plugin-static-copy@1.0.6:
resolution: {integrity: sha512-3uSvsMwDVFZRitqoWHj0t4137Kz7UynnJeq1EZlRW7e25h2068fyIZX4ORCCOAkfp1FklGxJNVJBkBOD+PZIew==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
vite: ^5.0.0
vite@5.4.8:
resolution: {integrity: sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -2316,10 +2263,6 @@ packages:
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
@@ -2327,18 +2270,6 @@ packages:
resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
engines: {node: '>=12'}
y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
yargs@17.7.2:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
yocto-queue@0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
@@ -3268,12 +3199,6 @@ snapshots:
dependencies:
source-map: 0.6.1
cliui@8.0.1:
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
color-convert@2.0.1:
dependencies:
color-name: 1.1.4
@@ -3369,8 +3294,6 @@ snapshots:
deep-is@0.1.4: {}
define-lazy-prop@2.0.0: {}
defu@6.1.4: {}
delayed-stream@1.0.0: {}
@@ -3425,8 +3348,6 @@ snapshots:
dependencies:
jake: 10.9.2
emoji-regex@8.0.0: {}
encodeurl@1.0.2: {}
entities@2.2.0: {}
@@ -3486,8 +3407,6 @@ snapshots:
'@esbuild/win32-ia32': 0.23.1
'@esbuild/win32-x64': 0.23.1
escalade@3.2.0: {}
escape-html@1.0.3: {}
escape-string-regexp@4.0.0: {}
@@ -3672,13 +3591,17 @@ snapshots:
jsonfile: 6.1.0
universalify: 2.0.1
fs-extra@11.2.0:
dependencies:
graceful-fs: 4.2.11
jsonfile: 6.1.0
universalify: 2.0.1
fs.realpath@1.0.0: {}
fsevents@2.3.3:
optional: true
get-caller-file@2.0.5: {}
get-tsconfig@4.8.1:
dependencies:
resolve-pkg-maps: 1.0.0
@@ -3772,12 +3695,8 @@ snapshots:
dependencies:
binary-extensions: 2.3.0
is-docker@2.2.1: {}
is-extglob@2.1.1: {}
is-fullwidth-code-point@3.0.0: {}
is-glob@4.0.3:
dependencies:
is-extglob: 2.1.1
@@ -3786,10 +3705,6 @@ snapshots:
is-path-inside@3.0.3: {}
is-wsl@2.2.0:
dependencies:
is-docker: 2.2.1
isexe@2.0.0: {}
jake@10.9.2:
@@ -3978,12 +3893,6 @@ snapshots:
dependencies:
wrappy: 1.0.2
open@8.4.2:
dependencies:
define-lazy-prop: 2.0.0
is-docker: 2.2.1
is-wsl: 2.2.0
optionator@0.9.4:
dependencies:
deep-is: 0.1.4
@@ -4097,8 +4006,6 @@ snapshots:
relateurl@0.2.7: {}
require-directory@2.1.1: {}
resolve-from@4.0.0: {}
resolve-pkg-maps@1.0.0: {}
@@ -4109,15 +4016,6 @@ snapshots:
dependencies:
glob: 7.2.3
rollup-plugin-visualizer@5.12.0(rollup@4.22.4):
dependencies:
open: 8.4.2
picomatch: 2.3.1
source-map: 0.7.4
yargs: 17.7.2
optionalDependencies:
rollup: 4.22.4
rollup@4.22.4:
dependencies:
'@types/estree': 1.0.5
@@ -4181,18 +4079,10 @@ snapshots:
source-map@0.6.1: {}
source-map@0.7.4: {}
state-local@1.0.7: {}
statuses@1.5.0: {}
string-width@4.2.3:
dependencies:
emoji-regex: 8.0.0
is-fullwidth-code-point: 3.0.0
strip-ansi: 6.0.1
strip-ansi@6.0.1:
dependencies:
ansi-regex: 5.0.1
@@ -4391,15 +4281,6 @@ snapshots:
evtd: 0.2.4
vue: 3.5.10(typescript@5.6.2)
vite-plugin-compression@0.5.1(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0)):
dependencies:
chalk: 4.1.2
debug: 4.3.7
fs-extra: 10.1.0
vite: 5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0)
transitivePeerDependencies:
- supports-color
vite-plugin-html@3.2.2(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0)):
dependencies:
'@rollup/pluginutils': 4.2.1
@@ -4431,6 +4312,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
vite-plugin-static-copy@1.0.6(vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0)):
dependencies:
chokidar: 3.6.0
fast-glob: 3.3.2
fs-extra: 11.2.0
picocolors: 1.1.0
vite: 5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0)
vite@5.4.8(@types/node@20.16.10)(sass@1.79.4)(terser@5.33.0):
dependencies:
esbuild: 0.21.5
@@ -4528,30 +4417,10 @@ snapshots:
word-wrap@1.2.5: {}
wrap-ansi@7.0.0:
dependencies:
ansi-styles: 4.3.0
string-width: 4.2.3
strip-ansi: 6.0.1
wrappy@1.0.2: {}
xml-name-validator@4.0.0: {}
y18n@5.0.8: {}
yargs-parser@21.1.1: {}
yargs@17.7.2:
dependencies:
cliui: 8.0.1
escalade: 3.2.0
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
yargs-parser: 21.1.1
yocto-queue@0.1.0: {}
zrender@5.6.0:

View File

@@ -15,7 +15,7 @@ async function setupApp() {
const app = createApp(App)
app.use(VueMonacoEditorPlugin, {
paths: {
vs: 'https://cdnjs.admincdn.com/monaco-editor/0.48.0/min/vs'
vs: '/assets/vs'
},
'vs/nls': {
availableLanguages: { '*': 'zh-cn' }

2
web/types/env.d.ts vendored
View File

@@ -8,8 +8,6 @@ interface ViteEnv {
VITE_PUBLIC_PATH: string
VITE_BASE_API: string
VITE_PROXY_TYPE?: ProxyType
VITE_USE_COMPRESS?: boolean
VITE_COMPRESS_TYPE?: 'gzip' | 'brotliCompress' | 'deflate' | 'deflateRaw'
}
interface ProxyConfig {

View File

@@ -8,7 +8,6 @@ import { setupVitePlugins } from './build/plugins'
export default defineConfig((configEnv: ConfigEnv) => {
const srcPath = getSrcPath()
const rootPath = getRootPath()
const isBuild = configEnv.command === 'build'
const viteEnv = convertEnv(loadEnv(configEnv.mode, process.cwd()))
@@ -22,7 +21,7 @@ export default defineConfig((configEnv: ConfigEnv) => {
}
},
define: viteDefine,
plugins: setupVitePlugins(viteEnv, isBuild),
plugins: setupVitePlugins(viteEnv),
server: {
host: '0.0.0.0',
port: VITE_PORT,