mirror of
https://github.com/xiangshu233/vue3-vant4-mobile.git
synced 2025-04-06 03:57:47 +08:00
chore: 处理 pre 问题
This commit is contained in:
parent
be50cd53f9
commit
e663eb92d4
@ -16,7 +16,7 @@ VITE_DROP_CONSOLE = true
|
||||
|
||||
# API 接口地址
|
||||
# 如果没有跨域问题,直接在这里配置即可
|
||||
VITE_GLOB_API_URL =
|
||||
VITE_GLOB_API_URL = https://development.com
|
||||
|
||||
# 图片上传地址
|
||||
VITE_GLOB_UPLOAD_URL =
|
||||
|
28
.env.pre
Normal file
28
.env.pre
Normal file
@ -0,0 +1,28 @@
|
||||
# 是否开启mock
|
||||
VITE_USE_MOCK = true
|
||||
|
||||
# 网站根目录
|
||||
VITE_PUBLIC_PATH = /
|
||||
|
||||
# 是否删除console
|
||||
VITE_DROP_CONSOLE = false
|
||||
|
||||
# API
|
||||
VITE_GLOB_API_URL = https://pre.com
|
||||
|
||||
# 图片上传地址
|
||||
VITE_GLOB_UPLOAD_URL =
|
||||
|
||||
# 图片前缀地址
|
||||
VITE_GLOB_IMG_URL =
|
||||
|
||||
# 接口 (api) 前缀
|
||||
VITE_GLOB_API_URL_PREFIX = /api
|
||||
|
||||
# 是否启用gzip压缩或brotli压缩
|
||||
# 可选: gzip | brotli | none
|
||||
# 如果你需要多种形式,你可以用','来分隔
|
||||
VITE_BUILD_COMPRESS = 'gzip'
|
||||
|
||||
# 使用压缩时是否删除原始文件,默认为false
|
||||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
@ -8,7 +8,7 @@ VITE_PUBLIC_PATH = /
|
||||
VITE_DROP_CONSOLE = true
|
||||
|
||||
# API
|
||||
VITE_GLOB_API_URL =
|
||||
VITE_GLOB_API_URL = https://productions.com
|
||||
|
||||
# 图片上传地址
|
||||
VITE_GLOB_UPLOAD_URL =
|
||||
|
@ -12,6 +12,7 @@
|
||||
"bootstrap": "pnpm install",
|
||||
"serve": "npm run dev",
|
||||
"dev": "vite",
|
||||
"build:pre": "cross-env NODE_ENV=pre vite build -m pre && esno ./build/script/postBuild.ts",
|
||||
"build": "cross-env NODE_ENV=production vite build && esno ./build/script/postBuild.ts",
|
||||
"build:no-cache": "pnpm clean:cache && npm run build",
|
||||
"report": "cross-env REPORT=true npm run build",
|
||||
|
@ -69,8 +69,9 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||
|
||||
esbuild: {
|
||||
// 使用 esbuild 压缩 剔除 console.log
|
||||
pure: VITE_DROP_CONSOLE ? ['console.log', 'debugger'] : [],
|
||||
// pure: VITE_DROP_CONSOLE ? ['console.log', 'debugger'] : [],
|
||||
// minify: true, // minify: true, 等于 minify: 'esbuild',
|
||||
drop: VITE_DROP_CONSOLE ? ['debugger', 'console'] : [],
|
||||
},
|
||||
|
||||
build: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user