Skip to content

Commit 91160b2

Browse files
hannoeruantfu
andauthored
fix: exclude node_modules but keep @slidev/client in windicss scan (#164)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
1 parent bbb3d31 commit 91160b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/slidev/node/plugins/windicss.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import WindiCSS, { defaultConfigureFiles } from 'vite-plugin-windicss'
33
import { ResolvedSlidevOptions, SlidevPluginOptions } from '..'
44

55
export function createWindiCSSPlugin(
6-
{ themeRoots, clientRoot }: ResolvedSlidevOptions,
6+
{ themeRoots, clientRoot, userRoot }: ResolvedSlidevOptions,
77
{ windicss: windiOptions }: SlidevPluginOptions,
88
) {
99
return WindiCSS(
@@ -13,6 +13,9 @@ export function createWindiCSSPlugin(
1313
...themeRoots.map(i => `${i}/windi.config.ts`),
1414
resolve(clientRoot, 'windi.config.ts'),
1515
],
16+
onOptionsResolved(config) {
17+
config.scanOptions.include.push(`!${resolve(userRoot, 'node_modules')}`)
18+
},
1619
...windiOptions,
1720
},
1821
{

0 commit comments

Comments
 (0)