base url 通过环境变量设置
This commit is contained in:
parent
083ce9d093
commit
9365c74f8f
@ -1 +0,0 @@
|
||||
VITE_BASE_PATH=/
|
@ -1 +0,0 @@
|
||||
VITE_BASE_PATH=/demo/devstandard/
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
node_modules
|
||||
docs/.vitepress/cache
|
||||
docs/.vitepress/dist
|
||||
**/cache
|
||||
**/dist
|
||||
|
@ -2,10 +2,22 @@ import { defineConfig } from 'vitepress'
|
||||
|
||||
import { getSidebar } from 'vitepress-plugin-auto-sidebar'
|
||||
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
base: process.env.VITE_BASE_PATH || '/',
|
||||
base: process.env.NODE_ENV === 'development' ? '/' : '/demo/devstandard/',
|
||||
// base: '/demo/devstandard/',
|
||||
markdown: {
|
||||
config: (md) => {
|
||||
const render = md.render
|
||||
md.render = function (src, env) {
|
||||
return `<div v-pre>${render.call(this, src, env)}</div>`
|
||||
}
|
||||
},
|
||||
html: false,
|
||||
attrs: {
|
||||
disable: true
|
||||
},
|
||||
},
|
||||
title: 'webDevStandard',
|
||||
description: '前端开发规范',
|
||||
themeConfig: {
|
||||
@ -42,6 +54,7 @@ export default defineConfig({
|
||||
}),
|
||||
},
|
||||
},
|
||||
outDir: "../dist",
|
||||
vite: {
|
||||
assetsInclude: ['**/*.jpg', '**/*.png', '**/*.gif', '**/*.zip', '**/*.pdf','**/*.webp'],
|
||||
plugins: []
|
||||
|
Loading…
x
Reference in New Issue
Block a user