Skip to content

Commit 647f70b

Browse files
committed
chore: fix buid bug
1 parent 0c2dddf commit 647f70b

7 files changed

Lines changed: 1264 additions & 137 deletions

File tree

components.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export {}
99
declare module 'vue' {
1010
export interface GlobalComponents {
1111
BusinessComp: typeof import('./src/components/left-comp/business-comp/index.vue')['default']
12-
BusinessContainer: typeof import('./src/components/left-comp/business-container/index.vue')['default']
1312
ContainerComp: typeof import('./src/components/left-comp/container-comp/index.vue')['default']
1413
DraggableTransition: typeof import('./src/components/common/draggable-transition/index.vue')['default']
1514
ElAside: typeof import('element-plus/es')['ElAside']

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "demo-app",
2+
"name": "mobile-lowcode",
33
"version": "0.0.0",
44
"private": true,
55
"type": "module",
@@ -55,6 +55,7 @@
5555
"@types/node": "^22.15.32",
5656
"@typescript-eslint/eslint-plugin": "^8.38.0",
5757
"@typescript-eslint/parser": "^8.38.0",
58+
"@vitejs/plugin-legacy": "^7.1.0",
5859
"@vitejs/plugin-vue": "^6.0.0",
5960
"@vitest/eslint-plugin": "^1.2.7",
6061
"@vue/eslint-config-prettier": "^10.2.0",
@@ -63,7 +64,6 @@
6364
"@vue/tsconfig": "^0.7.0",
6465
"eslint": "^9.29.0",
6566
"eslint-config-prettier": "^10.1.8",
66-
"eslint-define-config": "^2.1.0",
6767
"eslint-plugin-import": "^2.32.0",
6868
"eslint-plugin-prettier": "^5.5.3",
6969
"eslint-plugin-vue": "~10.2.0",

pnpm-lock.yaml

Lines changed: 1238 additions & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

preview/utils/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import axios, { type AxiosRequestConfig } from 'axios';
1+
import axios, { type AxiosRequestConfig,type InternalAxiosRequestConfig } from 'axios';
22
import qs from 'qs';
33
// import store from '@/store'
44
import { Toast } from 'vant';
@@ -11,7 +11,7 @@ const service = axios.create({
1111
withCredentials: true, // send cookies when cross-domain requests
1212
timeout: 10000, // request timeout
1313
});
14-
interface CustomAxiosRequestConfig extends AxiosRequestConfig {
14+
interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
1515
hideLoading?: boolean;
1616
}
1717

preview/views/slot-item.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import type { FetchApiItem, VisualEditorActions, VisualEditorBlockData, VisualEd
1818
import request from '../utils/request';
1919
import { ContentTypeEnum } from '@/enums/httpEnum';
2020
import { useAnimate } from '@/hooks/useAnimate';
21+
import { AxiosHeaders } from 'axios';
2122
2223
export default defineComponent({
2324
name: 'SlotItem',
@@ -49,9 +50,9 @@ import { useAnimate } from '@/hooks/useAnimate';
4950
// const pramsObj = {};
5051
await request({
5152
...options,
52-
headers: {
53+
headers: new AxiosHeaders({
5354
'Content-Type': ContentTypeEnum[options.contentType],
54-
},
55+
}),
5556
data: {
5657
username: 'admin',
5758
password: '123456',

tsconfig.app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"strictFunctionTypes": false,
3838
// "jsxFactory": "h",
3939
// "jsxFragmentFactory": "Fragment",
40-
"types": ["element-plus", "vite/client"],
40+
"types": ["vite/client"],
4141
"typeRoots": ["./node_modules/@types/", "./types"],
4242
"paths": {
4343
"@/*": ["./src/*"]

vite.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import AutoImport from 'unplugin-auto-import/vite'
99
import { ElementPlusResolver, VantResolver } from 'unplugin-vue-components/resolvers'
1010
import WindiCSS from 'vite-plugin-windicss'
1111
import { resolve } from 'path'
12+
import legacy from '@vitejs/plugin-legacy'
13+
14+
const prefix = `monaco-editor/esm/vs`;
1215

1316
// https://vite.dev/config/
1417
export default defineConfig({
@@ -43,13 +46,17 @@ export default defineConfig({
4346
// // 生成类型声明文件 (可选)
4447
dts: true,
4548
}),
49+
legacy({
50+
targets: ['defaults', 'not IE 11'], // 定义目标浏览器
51+
})
4652
],
4753
build:{
4854
cssCodeSplit:true,// 如果设置false,整个项目中的所有css将被提取到一个css文件
4955
sourcemap:false, // 构建后是否生成source map文件。如果为true,将会创建一个独立的source map文件
5056
target: 'modules', // 设置最终构建的浏览器兼容目标。默认值是一个 Vite 特有的值——'modules' 还可设置为 'es2015' 'es2016'等
5157
chunkSizeWarningLimit: 550, // 单位kb 打包后文件大小警告的限制 (文件大于此此值会出现警告)
5258
assetsInlineLimit: 4096, // 单位字节(1024等于1kb) 小于此阈值的导入或引用资源将内联为 base64 编码,以避免额外的 http 请求。设置为 0 可以完全禁用此项。
59+
// assetsInlineLimit: 0 , // 禁止小文件内联(确保 Worker 文件独立输出)
5360
minify: 'terser', // 'terser' 相对较慢,但大多数情况下构建后的文件体积更小。'esbuild' 最小化混淆更快但构建后的文件相对更大。
5461
terserOptions: {
5562

@@ -63,10 +70,21 @@ export default defineConfig({
6370
main: resolve(__dirname, 'index.html'),
6471
preview: resolve(__dirname, 'preview/index.html'),
6572
},
73+
output: {
74+
manualChunks: {
75+
jsonWorker: [`${prefix}/language/json/json.worker`],
76+
cssWorker: [`${prefix}/language/css/css.worker`],
77+
htmlWorker: [`${prefix}/language/html/html.worker`],
78+
tsWorker: [`${prefix}/language/typescript/ts.worker`],
79+
editorWorker: [`${prefix}/editor/editor.worker`],
80+
},
81+
},
6682
},
6783
},
84+
// 强制 Vite 在开发服务器启动时对指定的依赖包进行预编译、代码合并、依赖缓存(结果存储在 node_modules/.vite 目录,后续启动直接复用)
6885
optimizeDeps: {
6986
include: ['@vueuse/core', 'element-plus', 'vant', 'lodash-es', 'vuedraggable'],
87+
exclude: ['monaco-editor']
7088
},
7189
resolve: {
7290
alias: {

0 commit comments

Comments
 (0)