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
|
node_modules
|
||||||
docs/.vitepress/cache
|
**/cache
|
||||||
docs/.vitepress/dist
|
**/dist
|
||||||
|
@ -2,10 +2,22 @@ import { defineConfig } from 'vitepress'
|
|||||||
|
|
||||||
import { getSidebar } from 'vitepress-plugin-auto-sidebar'
|
import { getSidebar } from 'vitepress-plugin-auto-sidebar'
|
||||||
|
|
||||||
|
|
||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default defineConfig({
|
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',
|
title: 'webDevStandard',
|
||||||
description: '前端开发规范',
|
description: '前端开发规范',
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
@ -42,6 +54,7 @@ export default defineConfig({
|
|||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
outDir: "../dist",
|
||||||
vite: {
|
vite: {
|
||||||
assetsInclude: ['**/*.jpg', '**/*.png', '**/*.gif', '**/*.zip', '**/*.pdf','**/*.webp'],
|
assetsInclude: ['**/*.jpg', '**/*.png', '**/*.gif', '**/*.zip', '**/*.pdf','**/*.webp'],
|
||||||
plugins: []
|
plugins: []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user