二级目录部署

This commit is contained in:
Zheng Jie
2022-03-22 11:19:53 +08:00
parent 337794ee6f
commit 06f1f53dad
4 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
.DS_Store
node_modules/
dist/
demo/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta base="/demo/">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">

View File

@@ -61,8 +61,9 @@ export const constantRouterMap = [
]
export default new Router({
// mode: 'hash',
mode: 'history',
mode: 'hash',
base: '/demo/',
// mode: 'history',
scrollBehavior: () => ({ y: 0 }),
routes: constantRouterMap
})

View File

@@ -12,9 +12,8 @@ const port = 8013 // 端口配置
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
// hash 模式下可使用
// publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
publicPath: '/',
outputDir: 'dist',
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/demo/',
outputDir: 'demo',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,