Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
98efd42c
Commit
98efd42c
authored
Apr 08, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改vite的base配置
parent
d092d238
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
vite.config.ts
vite.config.ts
+5
-3
No files found.
vite.config.ts
View file @
98efd42c
...
@@ -15,10 +15,12 @@ import Icons from 'unplugin-icons/vite'
...
@@ -15,10 +15,12 @@ import Icons from 'unplugin-icons/vite'
import
path
from
'node:path'
import
path
from
'node:path'
// 获取到执行脚本的--参数
// 获取到执行脚本的--参数
import
pkg
from
'./package.json'
import
pkg
from
'./package.json'
// @ts-ignore
import
{
getCurrentBranchName
,
getDeploySlug
}
from
'./deploy/util.js'
// https://vite.dev/config/
export
default
defineConfig
(({
mode
})
=>
{
export
default
defineConfig
(({
mode
})
=>
{
return
{
return
{
base
:
mode
===
'test'
?
`/
${
getDeploySlug
(
getCurrentBranchName
())}
/`
:
'/'
,
define
:
{
define
:
{
__CORE_LIB_VERSION__
:
JSON
.
stringify
(
pkg
.
dependencies
),
__CORE_LIB_VERSION__
:
JSON
.
stringify
(
pkg
.
dependencies
),
},
},
...
@@ -62,7 +64,7 @@ export default defineConfig(({ mode }) => {
...
@@ -62,7 +64,7 @@ export default defineConfig(({ mode }) => {
symbolId
:
'icon-[dir]-[name]'
,
symbolId
:
'icon-[dir]-[name]'
,
}),
}),
mode
===
'development'
&&
visualizer
(),
// 开发环境打包才需要
mode
===
'development'
&&
visualizer
(),
// 开发环境打包才需要
pushUpdatePlugin
(),
mode
===
'production'
&&
pushUpdatePlugin
(),
// 生产环境打包才更新推送
],
],
server
:
{
server
:
{
// 是否开启 https
// 是否开启 https
...
@@ -80,7 +82,7 @@ export default defineConfig(({ mode }) => {
...
@@ -80,7 +82,7 @@ export default defineConfig(({ mode }) => {
// },
// },
},
},
build
:
{
build
:
{
minify
:
'esbuild'
,
minify
:
'esbuild'
,
// 'esbuild'
chunkSizeWarningLimit
:
1000
,
chunkSizeWarningLimit
:
1000
,
rollupOptions
:
{
rollupOptions
:
{
output
:
{
output
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment