Skip to content

Commit

Permalink
fix: improve fs allow
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 8, 2021
1 parent c1ba483 commit 2e9264f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/node/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ import path from 'path'
import { Alias, AliasOptions } from 'vite'

const PKG_ROOT = path.join(__dirname, '../../')
export const APP_PATH = path.join(__dirname, '../client/app')
export const SHARED_PATH = path.join(__dirname, '../client/shared')
export const DEFAULT_THEME_PATH = path.join(
__dirname,
'../client/theme-default'
)
export const DIST_CLIENT_PATH = path.join(__dirname, '../client')
export const APP_PATH = path.join(DIST_CLIENT_PATH, 'app')
export const SHARED_PATH = path.join(DIST_CLIENT_PATH, 'shared')
export const DEFAULT_THEME_PATH = path.join(DIST_CLIENT_PATH, 'theme-default')

// special virtual file
// we can't directly import '/@siteData' because
Expand Down
4 changes: 2 additions & 2 deletions src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createMarkdownToVueRenderFn,
MarkdownCompileResult
} from './markdownToVue'
import { APP_PATH, SITE_DATA_REQUEST_PATH } from './alias'
import { DIST_CLIENT_PATH, APP_PATH, SITE_DATA_REQUEST_PATH } from './alias'
import createVuePlugin from '@vitejs/plugin-vue'
import { slash } from './utils/slash'
import { OutputAsset, OutputChunk } from 'rollup'
Expand Down Expand Up @@ -87,7 +87,7 @@ export function createVitePressPlugin(
},
server: {
fs: {
allow: [APP_PATH, srcDir]
allow: [DIST_CLIENT_PATH, srcDir, process.cwd()]
}
}
})
Expand Down

0 comments on commit 2e9264f

Please sign in to comment.