@roki-h5/create-roki-app 0.1.11 → 0.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roki-h5/create-roki-app",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Roki H5 项目脚手架",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@roki-h5/scaffold-template",
3
3
  "private": true,
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite --mode development",
@@ -17,6 +17,7 @@
17
17
  "axios": "^1.7.9",
18
18
  "event-source-polyfill": "^1.0.31",
19
19
  "pinia": "^2.3.0",
20
+ "vconsole": "^3.15.1",
20
21
  "vue": "^3.5.13",
21
22
  "vue-router": "^4.5.0"
22
23
  },
@@ -1,6 +1,7 @@
1
1
  import { createApp } from 'vue'
2
2
  import RokiUI from '@roki-h5/ui'
3
3
  import '@roki-h5/ui/style.css'
4
+ import { appEnv } from '@config/env'
4
5
  import { setupRem } from '@/utils/rem'
5
6
  import pinia from '@/stores'
6
7
  import router from '@/router'
@@ -9,8 +10,22 @@ import '@/assets/styles/main.css'
9
10
 
10
11
  setupRem()
11
12
 
12
- const app = createApp(App)
13
- app.use(pinia)
14
- app.use(router)
15
- app.use(RokiUI)
16
- app.mount('#app')
13
+ async function setupMobileDebugConsole() {
14
+ // 仅测试环境(build:test / VITE_ENV=test)启用 vConsole
15
+ if (appEnv !== 'test') return
16
+
17
+ const { default: VConsole } = await import('vconsole')
18
+ new VConsole()
19
+ }
20
+
21
+ async function bootstrap() {
22
+ await setupMobileDebugConsole()
23
+
24
+ const app = createApp(App)
25
+ app.use(pinia)
26
+ app.use(router)
27
+ app.use(RokiUI)
28
+ app.mount('#app')
29
+ }
30
+
31
+ void bootstrap()