File tree 4 files changed +21
-19
lines changed
4 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 48
48
"umi-mock-middleware2" : " ^1.0.2" ,
49
49
"unplugin-vue-components" : " ^0.19.6" ,
50
50
"vite" : " ^2.9.9" ,
51
+ "vite-plugin-vconsole" : " ^1.2.2" ,
51
52
"vue-tsc" : " ^0.34.7"
52
53
}
53
54
}
Original file line number Diff line number Diff line change @@ -8,16 +8,6 @@ import './app.less'
8
8
// Vant 桌面端适配
9
9
import '@vant/touch-emulator'
10
10
11
- // debugger board
12
- import VConsole from 'vconsole'
13
- new VConsole ( { theme : 'light' } )
14
-
15
- // 结束调试后,可移除掉
16
- // vConsole.destroy()
17
-
18
- // vite-plugin-vconsole 社区版
19
- // https://github.com/vadxq/vite-plugin-vconsole
20
-
21
11
const app = createApp ( App )
22
12
23
13
app
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
4
4
import type { ConfigEnv , UserConfig } from 'vite'
5
5
import { visualizer } from 'rollup-plugin-visualizer'
6
6
import Components from 'unplugin-vue-components/vite'
7
+ import { viteVConsole } from 'vite-plugin-vconsole'
7
8
import { VantResolver } from 'unplugin-vue-components/resolvers'
8
9
import createMockServer from './build/mockServer'
9
10
import path from 'path'
10
11
11
12
// https://vitejs.dev/config/
12
- export default ( { mode } : ConfigEnv ) : UserConfig => {
13
+ export default ( { command , mode } : ConfigEnv ) : UserConfig => {
13
14
const root = process . cwd ( )
14
15
const env = loadEnv ( mode , root )
15
16
return {
@@ -19,18 +20,23 @@ export default ({ mode }: ConfigEnv): UserConfig => {
19
20
'process.env.VUE_APP_PUBLIC_PATH' : JSON . stringify ( env . VITE_APP_PUBLIC_PATH ) ,
20
21
} ,
21
22
plugins : [
22
- vue ( {
23
- // Reactivity transform is an experimental feature.
24
- // https://github.com/vuejs/rfcs/discussions/369.
25
- // reactivityTransform: true
26
- } ) ,
23
+ vue ( ) ,
27
24
vueJsx ( ) ,
28
25
visualizer ( ) ,
29
26
Components ( {
30
27
dts : true ,
31
28
resolvers : [ VantResolver ( ) ] ,
32
29
types : [ ] ,
33
30
} ) ,
31
+ viteVConsole ( {
32
+ entry : [ path . resolve ( 'src/main.ts' ) ] ,
33
+ localEnabled : command === 'serve' ,
34
+ enabled : false ,
35
+ config : {
36
+ maxLogNumber : 1000 ,
37
+ theme : 'light'
38
+ }
39
+ } )
34
40
] ,
35
41
resolve : {
36
42
alias : {
Original file line number Diff line number Diff line change @@ -1282,9 +1282,9 @@ copy-text-to-clipboard@^3.0.1:
1282
1282
integrity sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q==
1283
1283
1284
1284
core-js@^3.11.0 :
1285
- version "3.22.8 "
1286
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.8 .tgz#23f860b1fe60797cc4f704d76c93fea8a2f60631 "
1287
- integrity sha512-UoGQ/cfzGYIuiq6Z7vWL1HfkE9U9IZ4Ub+0XSiJTCzvbZzgPA69oDF2f+lgJ6dFFLEdjW5O6svvoKzXX23xFkA ==
1285
+ version "3.23.2 "
1286
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.23.2 .tgz#e07a60ca8b14dd129cabdc3d2551baf5a01c76f0 "
1287
+ integrity sha512-ELJOWxNrJfOH/WK4VJ3Qd+fOqZuOuDNDJz0xG6Bt4mGg2eO/UT9CljCrbqDGovjLKUrGajEEBcoTOc0w+yBYeQ ==
1288
1288
1289
1289
cross-env@^7.0.3 :
1290
1290
version "7.0.3"
@@ -3968,6 +3968,11 @@ vconsole@^3.14.6:
3968
3968
core-js "^3.11.0"
3969
3969
mutation-observer "^1.0.3"
3970
3970
3971
+ vite-plugin-vconsole@^1.2.2 :
3972
+ version "1.2.2"
3973
+ resolved "https://registry.yarnpkg.com/vite-plugin-vconsole/-/vite-plugin-vconsole-1.2.2.tgz#58d96835bf75aa034094febc57798f48fa1b9709"
3974
+ integrity sha512-eB0uyQzEQAijpxxcgnE9h/k0y6Lr5wiYeq+OW/4hPT7sNwd4KVqMKQXArTn5S6zy8Uo7ae7ulAU3atczekAGAw==
3975
+
3971
3976
vite@^2.9.9 :
3972
3977
version "2.9.12"
3973
3978
resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.12.tgz#b1d636b0a8ac636afe9d83e3792d4895509a941b"
You can’t perform that action at this time.
0 commit comments