af-mobile-client-vue3 1.0.98 → 1.1.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,123 +1,130 @@
1
- import type { ConfigEnv, UserConfig } from 'vite'
2
- import path from 'node:path'
3
- import process from 'node:process'
4
- import autoprefixer from 'autoprefixer'
5
- import viewport from 'postcss-mobile-forever'
6
- import { loadEnv } from 'vite'
7
- import { createVitePlugins } from './build/vite'
8
-
9
- // import fs from 'fs'
10
- export default ({ mode }: ConfigEnv): UserConfig => {
11
- const root = process.cwd()
12
- const env = loadEnv(mode, root)
13
-
14
- const appProxys = {}
15
-
16
- const v4Server = 'http://aote-office.8866.org:31567'
17
- const v3Server = 'http://aote-office.8866.org:31567'
18
- const OSSServerDev = 'http://192.168.50.67:30351'
19
- // const OSSServerProd = 'http://192.168.50.67:31351'
20
-
21
- return {
22
- base: env.VITE_APP_PUBLIC_PATH,
23
- plugins: [
24
- createVitePlugins(),
25
- ],
26
-
27
- server: {
28
- host: true,
29
- port: 7190,
30
- // https: {
31
- // key: fs.readFileSync('certs/127.0.0.1+2-key.pem'),
32
- // cert: fs.readFileSync('certs/127.0.0.1+2.pem')
33
- // },
34
- proxy: Object.assign({
35
- '/api/af-system/resource': {
36
- target: v4Server,
37
- ws: false,
38
- changeOrigin: true,
39
- },
40
- '/api/invoice': {
41
- target: 'http://219.153.176.6:8400/',
42
- rewrite: (path: string) => path.replace(/^\/api\//, '/'),
43
- ws: false,
44
- changeOrigin: true,
45
- },
46
- '/api/af-system/entity/t_files': {
47
- target: v3Server,
48
- ws: false,
49
- changeOrigin: true,
50
- },
51
- '/resource': {
52
- // pathRewrite: { '^/resource': '/' },
53
- target: v4Server,
54
- changeOrigin: true,
55
- },
56
- // '/api/af-auth/login': {
57
- // target: 'http://127.0.0.1:9200/',
58
- // rewrite: (path: string) => path.replace(/^\/api\/af-auth\//, '/'),
59
- // ws: false,
60
- // changeOrigin: true,
61
- // },
62
- '/api': {
63
- // v3用
64
- // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),
65
- target: v4Server,
66
- ws: false,
67
- changeOrigin: true,
68
- },
69
- '/oss': {
70
- target: OSSServerDev,
71
- rewrite: (path: string) => path.replace(/^\/oss\//, '/'),
72
- changeOrigin: true,
73
- },
74
- }, appProxys),
75
- },
76
-
77
- resolve: {
78
- alias: {
79
- '~@': path.join(__dirname, './src'),
80
- '@': path.join(__dirname, './src'),
81
- '~': path.join(__dirname, './src/assets'),
82
- '@af-mobile-client-vue3': path.join(__dirname, './src'),
83
- },
84
- },
85
-
86
- css: {
87
- // postcss 官网:www.postcss.com.cn/
88
- postcss: {
89
- plugins: [
90
- // 自动获取浏览器的流行度和能够支持的属性,并为 CSS 规则添加前缀
91
- autoprefixer(),
92
- viewport({
93
- appSelector: '#system-app',
94
- viewportWidth: 375,
95
- maxDisplayWidth: 800,
96
- appContainingBlock: 'auto',
97
- necessarySelectorWhenAuto: '.app-wrapper',
98
- rootContainingBlockSelectorList: ['van-tabbar', 'van-popup'],
99
- }),
100
- ],
101
- },
102
- },
103
-
104
- build: {
105
- chunkSizeWarningLimit: 2048,
106
- rollupOptions: {
107
- output: {
108
- // 打包时分割资源
109
- chunkFileNames: 'static/js/[name]-[hash].js',
110
- entryFileNames: 'static/js/[name]-[hash].js',
111
- assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
112
- manualChunks(id) {
113
- if (id.includes('node_modules'))
114
- return 'third' // 代码分割为第三方包
115
-
116
- if (id.includes('views'))
117
- return 'views' // 代码分割为业务视图
118
- },
119
- },
120
- },
121
- },
122
- }
123
- }
1
+ import type { ConfigEnv, UserConfig } from 'vite'
2
+ import path from 'node:path'
3
+ import process from 'node:process'
4
+ import autoprefixer from 'autoprefixer'
5
+ import viewport from 'postcss-mobile-forever'
6
+ import { loadEnv } from 'vite'
7
+ import { createVitePlugins } from './build/vite'
8
+
9
+ // import fs from 'fs'
10
+ export default ({ mode }: ConfigEnv): UserConfig => {
11
+ const root = process.cwd()
12
+ const env = loadEnv(mode, root)
13
+
14
+ const appProxys = {}
15
+
16
+ const v4Server = 'http://aote-office.8866.org:31567'
17
+ const v3Server = 'http://aote-office.8866.org:31567'
18
+ const OSSServerDev = 'http://192.168.50.67:30351'
19
+ const geoserver = 'http://39.104.49.8:30372'
20
+ // const OSSServerProd = 'http://192.168.50.67:31351'
21
+
22
+ return {
23
+ base: env.VITE_APP_PUBLIC_PATH,
24
+ plugins: [
25
+ createVitePlugins(),
26
+ ],
27
+
28
+ server: {
29
+ host: true,
30
+ port: 7190,
31
+ // https: {
32
+ // key: fs.readFileSync('certs/127.0.0.1+2-key.pem'),
33
+ // cert: fs.readFileSync('certs/127.0.0.1+2.pem')
34
+ // },
35
+ proxy: Object.assign({
36
+ '/api/af-system/resource': {
37
+ target: v4Server,
38
+ ws: false,
39
+ changeOrigin: true,
40
+ },
41
+ '/api/invoice': {
42
+ target: 'http://219.153.176.6:8400/',
43
+ rewrite: (path: string) => path.replace(/^\/api\//, '/'),
44
+ ws: false,
45
+ changeOrigin: true,
46
+ },
47
+ '/api/af-system/entity/t_files': {
48
+ target: v3Server,
49
+ ws: false,
50
+ changeOrigin: true,
51
+ },
52
+ '/resource': {
53
+ // pathRewrite: { '^/resource': '/' },
54
+ target: v4Server,
55
+ changeOrigin: true,
56
+ },
57
+ // '/api/af-auth/login': {
58
+ // target: 'http://127.0.0.1:9200/',
59
+ // rewrite: (path: string) => path.replace(/^\/api\/af-auth\//, '/'),
60
+ // ws: false,
61
+ // changeOrigin: true,
62
+ // },
63
+ // geoserver 转发
64
+ '/linepatrol/geoserver': {
65
+ target: geoserver,
66
+ changeOrigin: true,
67
+ rewrite: path => path.replace(/^\/linepatrol\/geoserver/, '/geoserver'),
68
+ },
69
+ '/api': {
70
+ // v3用
71
+ // rewrite: (path: string) => path.replace(/^\/api\/af-system\//, '/rs/'),
72
+ target: v4Server,
73
+ ws: false,
74
+ changeOrigin: true,
75
+ },
76
+ '/oss': {
77
+ target: OSSServerDev,
78
+ rewrite: (path: string) => path.replace(/^\/oss\//, '/'),
79
+ changeOrigin: true,
80
+ },
81
+ }, appProxys),
82
+ },
83
+
84
+ resolve: {
85
+ alias: {
86
+ '~@': path.join(__dirname, './src'),
87
+ '@': path.join(__dirname, './src'),
88
+ '~': path.join(__dirname, './src/assets'),
89
+ '@af-mobile-client-vue3': path.join(__dirname, './src'),
90
+ },
91
+ },
92
+
93
+ css: {
94
+ // postcss 官网:www.postcss.com.cn/
95
+ postcss: {
96
+ plugins: [
97
+ // 自动获取浏览器的流行度和能够支持的属性,并为 CSS 规则添加前缀
98
+ autoprefixer(),
99
+ viewport({
100
+ appSelector: '#system-app',
101
+ viewportWidth: 375,
102
+ maxDisplayWidth: 800,
103
+ appContainingBlock: 'auto',
104
+ necessarySelectorWhenAuto: '.app-wrapper',
105
+ rootContainingBlockSelectorList: ['van-tabbar', 'van-popup'],
106
+ }),
107
+ ],
108
+ },
109
+ },
110
+
111
+ build: {
112
+ chunkSizeWarningLimit: 2048,
113
+ rollupOptions: {
114
+ output: {
115
+ // 打包时分割资源
116
+ chunkFileNames: 'static/js/[name]-[hash].js',
117
+ entryFileNames: 'static/js/[name]-[hash].js',
118
+ assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
119
+ manualChunks(id) {
120
+ if (id.includes('node_modules'))
121
+ return 'third' // 代码分割为第三方包
122
+
123
+ if (id.includes('views'))
124
+ return 'views' // 代码分割为业务视图
125
+ },
126
+ },
127
+ },
128
+ },
129
+ }
130
+ }