Skip to content

Commit

Permalink
fix: allow vite server access to theme and local files
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Aug 20, 2021
1 parent bc78adb commit 9b9fdc7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/node/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path'
import { mergeConfig, Plugin, ResolvedConfig } from 'vite'
import { defineConfig, mergeConfig, Plugin, ResolvedConfig } from 'vite'
import { SiteConfig, resolveSiteData } from './config'
import {
createMarkdownToVueRenderFn,
Expand Down Expand Up @@ -71,7 +71,7 @@ export function createVitePressPlugin(
},

config() {
const baseConfig = {
const baseConfig = defineConfig({
resolve: {
alias
},
Expand All @@ -84,8 +84,13 @@ export function createVitePressPlugin(
// force include vue to avoid duplicated copies when linked + optimized
include: ['vue'],
exclude: ['@docsearch/js']
},
server: {
fs: {
allow: [APP_PATH, srcDir]
}
}
}
})
return userViteConfig
? mergeConfig(userViteConfig, baseConfig)
: baseConfig
Expand Down

0 comments on commit 9b9fdc7

Please sign in to comment.