Browse Source

fix:修改打包配置;

dxj
李朋徽 1 year ago
parent
commit
3e62a2c1d5
  1. 6
      .env.production
  2. 2
      package.json
  3. 4
      src/router/index.ts
  4. 3
      vite.config.ts

6
.env.production

@ -1,11 +1,11 @@
# 正式环境 # 正式环境
# 公共地址 # 公共地址
VITE_GLOB_BASE_URL = "http://223.99.228.207:19872" VITE_GLOB_BASE_URL = "http://192.168.1.134:9872"
# 本地MQTT地址 # 本地MQTT地址
VITE_GLOB_MQTT_HOST = "223.99.228.240" VITE_GLOB_MQTT_HOST = "192.168.1.231"
VITE_GLOB_MQTT_PORT = 28083 VITE_GLOB_MQTT_PORT = 8083
VITE_GLOB_MQTT_PROTOCOL = "ws" VITE_GLOB_MQTT_PROTOCOL = "ws"
# 本地MQTT用户名 # 本地MQTT用户名

2
package.json

@ -12,7 +12,7 @@
"dev:prod": "vite --host --mode production", "dev:prod": "vite --host --mode production",
"dev:zxh": "vite --host --mode zxh", "dev:zxh": "vite --host --mode zxh",
"dev:lsp": "vite --host --mode lsp", "dev:lsp": "vite --host --mode lsp",
"build": "vue-tsc && vite build", "build": "vue-tsc && vite build --mode production",
"preview": "vite preview", "preview": "vite preview",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix" "lint:fix": "eslint . --fix"

4
src/router/index.ts

@ -4,7 +4,7 @@ import type {
} from 'vue-router' } from 'vue-router'
import { import {
createRouter, createRouter,
createWebHistory, createWebHashHistory,
} from 'vue-router' } from 'vue-router'
import Layout from '@/layout/index.vue' import Layout from '@/layout/index.vue'
@ -85,7 +85,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
] ]
export const router = createRouter({ export const router = createRouter({
history: createWebHistory(), history: createWebHashHistory(import.meta.env.VITE_GLOB_BASE_URL),
routes: constantRoutes, routes: constantRoutes,
}) })

3
vite.config.ts

@ -19,9 +19,6 @@ export default defineConfig({
], ],
base: './', base: './',
publicDir: 'public', publicDir: 'public',
server: {
host: '0.0.0.0',
},
resolve: { resolve: {
// 配置路径别名 // 配置路径别名
alias: { alias: {

Loading…
Cancel
Save