Skip to content

Commit

Permalink
fix(config): exclude config.assetsInclude empty array (#10941)
Browse files Browse the repository at this point in the history
fixes #10926
  • Loading branch information
sun0day authored Nov 15, 2022
1 parent 8eed2ec commit 18c71dc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,11 @@ export async function resolveConfig(
? path.join(path.dirname(pkgPath), `node_modules/.vite`)
: path.join(resolvedRoot, `.vite`)

const assetsFilter = config.assetsInclude
? createFilter(config.assetsInclude)
: () => false
const assetsFilter =
config.assetsInclude &&
(!(config.assetsInclude instanceof Array) || config.assetsInclude.length)
? createFilter(config.assetsInclude)
: () => false

// create an internal resolver to be used in special scenarios, e.g.
// optimizer & handling css @imports
Expand Down

0 comments on commit 18c71dc

Please sign in to comment.