Skip to content

Commit

Permalink
feat: support globbing from dependencies (#2519)
Browse files Browse the repository at this point in the history
fix #2390
  • Loading branch information
brillout committed Apr 11, 2021
1 parent 1e3cd99 commit 7121553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/guide/features.md
Expand Up @@ -251,7 +251,7 @@ const modules = {
Note that:

- This is a Vite-only feature and is not a web or ES standard.
- The glob patterns are treated like import specifiers: they must be either relative (start with `./`) or absolute (start with `/`, resolved relative to project root). Globbing from dependencies is not supported.
- The glob patterns are treated like import specifiers: they must be either relative (start with `./`) or absolute (start with `/`, resolved relative to project root).
- The glob matching is done via `fast-glob` - check out its documentation for [supported glob patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax).

## Web Assembly
Expand Down
5 changes: 4 additions & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Expand Up @@ -96,7 +96,10 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
},

async transform(source, importer) {
if (importer.includes('node_modules')) {
if (
importer.includes('node_modules') &&
!source.includes('import.meta.glob')
) {
return
}

Expand Down

0 comments on commit 7121553

Please sign in to comment.