Merge pull request #151 from Annunx/vue-h5-template

fix: 修复设置vite.config.js base选项构建页面路径不正确问题
This commit is contained in:
fonghehe 2024-11-08 16:57:33 +08:00 committed by GitHub
commit 6421aecf77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View File

@ -84,12 +84,12 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[vue]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.fixAll.stylelint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

View File

@ -2,7 +2,7 @@ import { createRouter, createWebHistory, Router } from 'vue-router';
import routes from './routes';
const router: Router = createRouter({
history: createWebHistory('/'),
history: createWebHistory(import.meta.env.BASE_URL),
routes: routes,
});

View File

@ -15,6 +15,7 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
const viteEnv = wrapperEnv(env);
return {
base: '/',
root,
resolve: {
alias: [