We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d13aa20 commit 3cc87dbCopy full SHA for 3cc87db
src/index.ts
@@ -1,7 +1,11 @@
1
import fastGlob from 'fast-glob';
2
import { Plugin } from 'esbuild';
3
4
-const EsbuildPluginImportGlob = (): Plugin => ({
+interface Config {
5
+ ignorePaths: string[];
6
+}
7
+
8
+const EsbuildPluginImportGlob = (config?: Config): Plugin => ({
9
name: 'require-context',
10
setup: (build) => {
11
build.onResolve({ filter: /\*/ }, async (args) => {
@@ -22,6 +26,7 @@ const EsbuildPluginImportGlob = (): Plugin => ({
22
26
const files = (
23
27
await fastGlob(args.path, {
24
28
cwd: args.pluginData.resolveDir,
29
+ ignore: config?.ignorePaths ?? [],
25
30
})
31
).sort();
32
0 commit comments