Skip to content

Commit 556039b

Browse files
committed
chore: log
1 parent 4ae645f commit 556039b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

manifest.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { loadEnv } from 'vite'
55

66
// 获取环境变量的范例
77
const env = loadEnv(process.env.NODE_ENV!, path.resolve(process.cwd(), 'env'))
8+
// console.log('manifest.config.ts')
89
// console.log(env)
910
const {
1011
VITE_APP_TITLE,

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"locale": "zh-Hans",
7272
"h5": {
7373
"router": {
74-
"base": "/"
74+
"base": "/unibest/"
7575
}
7676
}
7777
}

vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default ({ command, mode }) => {
3131
// console.log(mode === process.env.NODE_ENV) // true
3232

3333
// mode: 区分生产环境还是开发环境
34+
console.log(process.env.UNI_PLATFORM) // 得到 mp-weixin, h5 等
3435
console.log(command, mode)
3536
// pnpm dev:h5 时得到 => serve development
3637
// pnpm build:h5 时得到 => build production
@@ -41,7 +42,6 @@ export default ({ command, mode }) => {
4142
// loadEnv(): 返回当前环境env文件中额外定义的变量
4243
const env = loadEnv(mode, path.resolve(process.cwd(), 'env'))
4344
console.log(env)
44-
console.log(process.env.UNI_PLATFORM) // 得到 mp-weixin, h5 等
4545

4646
return defineConfig({
4747
envDir: './env', // 自定义env目录

0 commit comments

Comments
 (0)