|
|
@ -1,5 +1,5 @@
|
|
|
|
import path from 'path'
|
|
|
|
import path from 'path'
|
|
|
|
import { mergeConfig, Plugin, ResolvedConfig } from 'vite'
|
|
|
|
import { defineConfig, mergeConfig, Plugin, ResolvedConfig } from 'vite'
|
|
|
|
import { SiteConfig, resolveSiteData } from './config'
|
|
|
|
import { SiteConfig, resolveSiteData } from './config'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
createMarkdownToVueRenderFn,
|
|
|
|
createMarkdownToVueRenderFn,
|
|
|
@ -71,7 +71,7 @@ export function createVitePressPlugin(
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
config() {
|
|
|
|
config() {
|
|
|
|
const baseConfig = {
|
|
|
|
const baseConfig = defineConfig({
|
|
|
|
resolve: {
|
|
|
|
resolve: {
|
|
|
|
alias
|
|
|
|
alias
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -84,8 +84,13 @@ export function createVitePressPlugin(
|
|
|
|
// force include vue to avoid duplicated copies when linked + optimized
|
|
|
|
// force include vue to avoid duplicated copies when linked + optimized
|
|
|
|
include: ['vue'],
|
|
|
|
include: ['vue'],
|
|
|
|
exclude: ['@docsearch/js']
|
|
|
|
exclude: ['@docsearch/js']
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
server: {
|
|
|
|
|
|
|
|
fs: {
|
|
|
|
|
|
|
|
allow: [APP_PATH, srcDir]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
return userViteConfig
|
|
|
|
return userViteConfig
|
|
|
|
? mergeConfig(userViteConfig, baseConfig)
|
|
|
|
? mergeConfig(userViteConfig, baseConfig)
|
|
|
|
: baseConfig
|
|
|
|
: baseConfig
|
|
|
|