Skip to content

Commit

Permalink
fix(integration): revert default excluding of node_modules, fix #3170
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 26, 2023
1 parent 783135c commit 24b2d10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/shared-integration/src/defaults.ts
@@ -1,7 +1,7 @@
import { cssIdRE } from '@unocss/core'

// picomatch patterns, used with rollup's createFilter
export const defaultPipelineExclude = [/[\/](node_modules|dist|\.temp|\.cache|\.vscode)[\/]/, cssIdRE]
export const defaultPipelineExclude = [cssIdRE]
export const defaultPipelineInclude = [/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/]

// micromatch patterns, used in postcss plugin
Expand Down
9 changes: 5 additions & 4 deletions packages/vscode/src/index.ts
Expand Up @@ -2,6 +2,7 @@ import path from 'path'
import type { ExtensionContext, StatusBarItem, WorkspaceConfiguration } from 'vscode'
import { StatusBarAlignment, commands, window, workspace } from 'vscode'
import { findUp } from 'find-up'
import type { FilterPattern } from '@rollup/pluginutils'
import { createFilter } from '@rollup/pluginutils'
import { version } from '../package.json'
import { log } from './log'
Expand Down Expand Up @@ -92,11 +93,11 @@ async function rootRegisterAuto(
) {
log.appendLine('📂 Auto roots search mode.')

const _exclude = config.get<string | string[]>('exclude')
const _include = config.get<string | string[]>('include')
const _exclude = config.get<FilterPattern>('exclude')
const _include = config.get<FilterPattern>('include')

const exclude = _exclude && _exclude.length ? _exclude : defaultPipelineExclude
const include = _include && _include.length ? _include : defaultPipelineInclude
const include: FilterPattern = _include || defaultPipelineInclude
const exclude: FilterPattern = _exclude || [/[\/](node_modules|dist|\.temp|\.cache|\.vscode)[\/]/, ...defaultPipelineExclude]
const filter = createFilter(include, exclude)

const cacheFileLookUp = new Set<string>()
Expand Down

0 comments on commit 24b2d10

Please sign in to comment.