Skip to content

Commit

Permalink
fix: try resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 27, 2021
1 parent 9b963aa commit 4b3f0e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/slidev/node/plugins/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { join } from 'path'
import { InlineConfig, mergeConfig, Plugin } from 'vite'
import isInstalledGlobally from 'is-installed-globally'
import { getIndexHtml } from '../common'
import { dependencies } from '../../../client/package.json'
import { ResolvedSlidevOptions } from '../options'
Expand Down Expand Up @@ -45,6 +47,10 @@ export function createConfigPlugin(options: ResolvedSlidevOptions): Plugin {
exclude: EXCLUDE,
},
}

if (isInstalledGlobally)
injection.cacheDir = join(options.cliRoot, 'node_module/.vite')

return mergeConfig(config, injection)
},
configureServer(server) {
Expand Down

0 comments on commit 4b3f0e1

Please sign in to comment.