af-mobile-client-vue3 1.3.99 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/vite.config.ts CHANGED
@@ -1,115 +1,115 @@
1
- import type { ConfigEnv, UserConfig } from 'vite'
2
- import path from 'node:path'
3
- import process from 'node:process'
4
- import { loadEnv } from 'vite'
5
- import { createVitePlugins } from './build/vite'
6
- import { exclude, include } from './build/vite/optimize'
7
-
8
- export default ({ mode }: ConfigEnv): UserConfig => {
9
- const root = process.cwd()
10
- const env = loadEnv(mode, root)
11
-
12
- const appProxys = {}
13
-
14
- const v4Server = 'http://192.168.50.67:31567'
15
- const v3Server = 'http://192.168.50.67:31567'
16
- const OSSServerDev = 'http://192.168.50.67:30351'
17
- const geoserver = 'http://39.104.49.8:30372'
18
- const mockServer = 'http://127.0.0.1:8086'
19
- // const OSSServerProd = 'http://192.168.50.67:31351'
20
-
21
- return {
22
- base: env.VITE_APP_PUBLIC_PATH,
23
- plugins: createVitePlugins(mode),
24
-
25
- server: {
26
- host: true,
27
- port: 7190,
28
- allowedHosts: [
29
- 'www.aofengcloud.com',
30
- '.aofengcloud.com',
31
- ],
32
- proxy: Object.assign({
33
- // '/api/af-system/user': {
34
- // target: 'http://127.0.0.1:9002/',
35
- // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/'),
36
- // ws: false,
37
- // changeOrigin: true,
38
- // },
39
- '/api/invoice': {
40
- target: 'http://219.153.176.6:8400/',
41
- rewrite: (path: string) => path.replace(/^\/api\//, '/'),
42
- ws: false,
43
- changeOrigin: true,
44
- },
45
- '/api/af-system/entity/t_files': {
46
- target: v3Server,
47
- ws: false,
48
- changeOrigin: true,
49
- },
50
- '/resource': {
51
- // pathRewrite: { '^/resource': '/' },
52
- target: v4Server,
53
- changeOrigin: true,
54
- },
55
- // '/api/af-auth/login': {
56
- // target: 'http://127.0.0.1:9200/',
57
- // rewrite: (path: string) => path.replace(/^\/api\/af-auth\//, '/'),
58
- // ws: false,
59
- // changeOrigin: true,
60
- // },
61
- // geoserver 转发
62
- '/linepatrol/geoserver': {
63
- target: geoserver,
64
- changeOrigin: true,
65
- rewrite: path => path.replace(/^\/linepatrol\/geoserver/, '/geoserver'),
66
- },
67
- '/api': {
68
- // v3用
69
- // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),
70
- target: v4Server,
71
- ws: false,
72
- changeOrigin: true,
73
- },
74
- '/oss': {
75
- target: OSSServerDev,
76
- rewrite: (path: string) => path.replace(/^\/oss\//, '/'),
77
- changeOrigin: true,
78
- },
79
- }, appProxys),
80
- },
81
-
82
- resolve: {
83
- alias: {
84
- '@': path.join(__dirname, './src'),
85
- '~': path.join(__dirname, './src/assets'),
86
- '~root': path.join(__dirname, '.'),
87
- '@af-mobile-client-vue3': path.join(__dirname, './src'),
88
- 'xml-utils': path.resolve(__dirname, 'node_modules/xml-utils'),
89
- },
90
- },
91
-
92
- build: {
93
- cssCodeSplit: false,
94
- chunkSizeWarningLimit: 2048,
95
- outDir: `./dist/${env.VITE_APP_OUT_DIR}`,
96
- rollupOptions: {
97
- output: {
98
- // 打包时分割资源
99
- chunkFileNames: 'static/js/[name]-[hash].js',
100
- entryFileNames: 'static/js/[name]-[hash].js',
101
- assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
102
- manualChunks(id) {
103
- if (id.includes('node_modules'))
104
- return 'third' // 代码分割为第三方包
105
-
106
- if (id.includes('views'))
107
- return 'views' // 代码分割为业务视图
108
- },
109
- },
110
- },
111
- },
112
-
113
- optimizeDeps: { include, exclude },
114
- }
115
- }
1
+ import type { ConfigEnv, UserConfig } from 'vite'
2
+ import path from 'node:path'
3
+ import process from 'node:process'
4
+ import { loadEnv } from 'vite'
5
+ import { createVitePlugins } from './build/vite'
6
+ import { exclude, include } from './build/vite/optimize'
7
+
8
+ export default ({ mode }: ConfigEnv): UserConfig => {
9
+ const root = process.cwd()
10
+ const env = loadEnv(mode, root)
11
+
12
+ const appProxys = {}
13
+
14
+ const v4Server = 'https://sfrqkj.com'
15
+ const v3Server = 'https://sfrqkj.com'
16
+ const OSSServerDev = 'https://sfrqkj.com'
17
+ const geoserver = 'https://sfrqkj.com'
18
+ const mockServer = 'http://127.0.0.1:8086'
19
+ // const OSSServerProd = 'http://192.168.50.67:31351'
20
+
21
+ return {
22
+ base: env.VITE_APP_PUBLIC_PATH,
23
+ plugins: createVitePlugins(mode),
24
+
25
+ server: {
26
+ host: true,
27
+ port: 7190,
28
+ allowedHosts: [
29
+ 'www.aofengcloud.com',
30
+ '.aofengcloud.com',
31
+ ],
32
+ proxy: Object.assign({
33
+ // '/api/af-system/user': {
34
+ // target: 'http://127.0.0.1:9002/',
35
+ // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/'),
36
+ // ws: false,
37
+ // changeOrigin: true,
38
+ // },
39
+ '/api/invoice': {
40
+ target: 'http://219.153.176.6:8400/',
41
+ rewrite: (path: string) => path.replace(/^\/api\//, '/'),
42
+ ws: false,
43
+ changeOrigin: true,
44
+ },
45
+ '/api/af-system/entity/t_files': {
46
+ target: v3Server,
47
+ ws: false,
48
+ changeOrigin: true,
49
+ },
50
+ '/resource': {
51
+ // pathRewrite: { '^/resource': '/' },
52
+ target: v4Server,
53
+ changeOrigin: true,
54
+ },
55
+ // '/api/af-auth/login': {
56
+ // target: 'http://127.0.0.1:9200/',
57
+ // rewrite: (path: string) => path.replace(/^\/api\/af-auth\//, '/'),
58
+ // ws: false,
59
+ // changeOrigin: true,
60
+ // },
61
+ // geoserver 转发
62
+ '/linepatrol/geoserver': {
63
+ target: geoserver,
64
+ changeOrigin: true,
65
+ rewrite: path => path.replace(/^\/linepatrol\/geoserver/, '/geoserver'),
66
+ },
67
+ '/api': {
68
+ // v3用
69
+ // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),
70
+ target: v4Server,
71
+ ws: false,
72
+ changeOrigin: true,
73
+ },
74
+ '/oss': {
75
+ target: OSSServerDev,
76
+ rewrite: (path: string) => path.replace(/^\/oss\//, '/'),
77
+ changeOrigin: true,
78
+ },
79
+ }, appProxys),
80
+ },
81
+
82
+ resolve: {
83
+ alias: {
84
+ '@': path.join(__dirname, './src'),
85
+ '~': path.join(__dirname, './src/assets'),
86
+ '~root': path.join(__dirname, '.'),
87
+ '@af-mobile-client-vue3': path.join(__dirname, './src'),
88
+ 'xml-utils': path.resolve(__dirname, 'node_modules/xml-utils'),
89
+ },
90
+ },
91
+
92
+ build: {
93
+ cssCodeSplit: false,
94
+ chunkSizeWarningLimit: 2048,
95
+ outDir: `./dist/${env.VITE_APP_OUT_DIR}`,
96
+ rollupOptions: {
97
+ output: {
98
+ // 打包时分割资源
99
+ chunkFileNames: 'static/js/[name]-[hash].js',
100
+ entryFileNames: 'static/js/[name]-[hash].js',
101
+ assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
102
+ manualChunks(id) {
103
+ if (id.includes('node_modules'))
104
+ return 'third' // 代码分割为第三方包
105
+
106
+ if (id.includes('views'))
107
+ return 'views' // 代码分割为业务视图
108
+ },
109
+ },
110
+ },
111
+ },
112
+
113
+ optimizeDeps: { include, exclude },
114
+ }
115
+ }