fix(build): allow serving files in dev from workspace root (#1647)

pull/1651/head
Divyansh Singh 2 years ago committed by GitHub
parent 428eec3750
commit dc596621cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,12 @@
import path from 'path' import path from 'path'
import c from 'picocolors' import c from 'picocolors'
import { defineConfig, mergeConfig, Plugin, ResolvedConfig } from 'vite' import {
defineConfig,
mergeConfig,
searchForWorkspaceRoot,
Plugin,
ResolvedConfig
} from 'vite'
import { SiteConfig } from './config' import { SiteConfig } from './config'
import { createMarkdownToVueRenderFn, clearCache } from './markdownToVue' import { createMarkdownToVueRenderFn, clearCache } from './markdownToVue'
import { import {
@ -117,7 +123,11 @@ export async function createVitePressPlugin(
}, },
server: { server: {
fs: { fs: {
allow: [DIST_CLIENT_PATH, srcDir, process.cwd()] allow: [
DIST_CLIENT_PATH,
srcDir,
searchForWorkspaceRoot(process.cwd())
]
} }
} }
}) })

Loading…
Cancel
Save