mirror of
https://gitee.com/h_mo/uniapp-vue3-vite-ts-template
synced 2025-04-05 06:12:44 +08:00
chore: 优化配置
This commit is contained in:
parent
6ca18b4bc2
commit
5ddc086f96
@ -2,6 +2,8 @@
|
||||
VITE_PROD = false
|
||||
VITE_DEV = true
|
||||
|
||||
VITE_PORT = 3000
|
||||
|
||||
# BASE_URL
|
||||
VITE_BASE_URL = https://api-catch.ranesuangyu.top
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vue3-Vite2-TS basic framework",
|
||||
"version": "1.0.0",
|
||||
"name": "uniapp_vue3_vite_ts",
|
||||
"version": "1.0.2",
|
||||
"scripts": {
|
||||
"dev:app": "uni -p app",
|
||||
"dev:custom": "uni -p",
|
||||
|
1686
pnpm-lock.yaml
generated
1686
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
@ -15,6 +15,7 @@ interface ImportMetaEnv {
|
||||
readonly VITE_PROD: boolean;
|
||||
readonly VITE_DEV: boolean;
|
||||
readonly VITE_APP_CACHE_PREFIX: string;
|
||||
readonly VITE_PORT: number;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name" : "uni-preset-vue-ts",
|
||||
"name" : "uniapp_vue3_vite_ts",
|
||||
"appid" : "__UNI__38BE53A",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionName" : "1.0.2",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
|
@ -3,6 +3,7 @@ import uni from '@dcloudio/vite-plugin-uni';
|
||||
import eslintPlugin from 'vite-plugin-eslint';
|
||||
import { resolve } from 'path';
|
||||
import { loadEnv } from 'vite';
|
||||
import { isProdMode } from './src/utils/env';
|
||||
|
||||
// https://vitejs.cn/config/
|
||||
export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
@ -23,12 +24,14 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
||||
terserOptions: {
|
||||
compress: {
|
||||
// 发布时删除 console
|
||||
// drop_console: true,
|
||||
drop_console: isProdMode(),
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: true,
|
||||
open: true,
|
||||
port: env.VITE_PORT as any,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: env.VITE_BASE_URL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user