Skip to content

Commit

Permalink
fix(build): allow serving files in dev from workspace root (#1647)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Nov 30, 2022
1 parent 428eec3 commit dc59662
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/node/plugin.ts
@@ -1,6 +1,12 @@
import path from 'path'
import c from 'picocolors'
import { defineConfig, mergeConfig, Plugin, ResolvedConfig } from 'vite'
import {
defineConfig,
mergeConfig,
searchForWorkspaceRoot,
Plugin,
ResolvedConfig
} from 'vite'
import { SiteConfig } from './config'
import { createMarkdownToVueRenderFn, clearCache } from './markdownToVue'
import {
Expand Down Expand Up @@ -117,7 +123,11 @@ export async function createVitePressPlugin(
},
server: {
fs: {
allow: [DIST_CLIENT_PATH, srcDir, process.cwd()]
allow: [
DIST_CLIENT_PATH,
srcDir,
searchForWorkspaceRoot(process.cwd())
]
}
}
})
Expand Down

0 comments on commit dc59662

Please sign in to comment.