修改构建设置

This commit is contained in:
York 2025-02-20 13:58:35 +08:00
parent 03889a039a
commit 4d65752d1c
3 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@ -7,6 +7,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script type="module" src="./src/main.tsx"></script>
</body>
</html>

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"build": "tsc && vite build",
"lint": "eslint .",
"preview": "vite preview"
},

View File

@ -3,5 +3,10 @@ import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
base: './', // 添加这一行
base: '/', // 修改这里
build: {
outDir: 'dist',
assetsDir: 'assets',
sourcemap: false
}
})