Skip to content

Commit

Permalink
fix: exclude node_modules but keep @slidev/client in windicss scan (#164
Browse files Browse the repository at this point in the history
)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
hannoeru and antfu committed May 22, 2021
1 parent bbb3d31 commit 91160b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/slidev/node/plugins/windicss.ts
Expand Up @@ -3,7 +3,7 @@ import WindiCSS, { defaultConfigureFiles } from 'vite-plugin-windicss'
import { ResolvedSlidevOptions, SlidevPluginOptions } from '..'

export function createWindiCSSPlugin(
{ themeRoots, clientRoot }: ResolvedSlidevOptions,
{ themeRoots, clientRoot, userRoot }: ResolvedSlidevOptions,
{ windicss: windiOptions }: SlidevPluginOptions,
) {
return WindiCSS(
Expand All @@ -13,6 +13,9 @@ export function createWindiCSSPlugin(
...themeRoots.map(i => `${i}/windi.config.ts`),
resolve(clientRoot, 'windi.config.ts'),
],
onOptionsResolved(config) {
config.scanOptions.include.push(`!${resolve(userRoot, 'node_modules')}`)
},
...windiOptions,
},
{
Expand Down

0 comments on commit 91160b2

Please sign in to comment.