-
Only works with
platform=node
andbundle=true
-
The majority of the automated tests covers
format=cjs
-
Dynamic imports with top-level await won't work with
format=cjs
-
Does it work with
format=esm
?- The esm output format was tested to the extent necessary to attain 100% code coverage; however, it was not thoroughly examined for all conceivable scenarios and opportunities.
-
Does
format=cjs
mean the plugin only works with a CommonJS codebase?- Not at all, you can use the plugin with your ES codebase. The
format=cjs
is about the esbuild output format. The library has been tested and works with ES modules.
- Not at all, you can use the plugin with your ES codebase. The
-
Does it work with non-Node.js platforms?
- I haven't had the time to write tests to cover non-Node.js platforms, so I intentionally limited the usage to on the Node.js for now.
-
Are there any plans to migrate it to Go?
- Yes but I need to learn Go first.
-
The
node_modules
folders are always ignored. -
Only the following kind of paths are supported:
- dynamic-import
- import-statement
- require-call
-
It acts on paths containing one of these characters:
?
+
*
{
}
[
]
(
)
. -
It uses fast-glob as the matching engine.
pnpm add esbuild-plugin-wildcard-imports --save-dev
yarn add esbuild-plugin-wildcard-imports --dev
npm install esbuild-plugin-wildcard-imports --save-dev
import * as esbuild from 'esbuild'
import wildcardImports from 'esbuild-plugin-wildcard-imports'
await esbuild.build({
plugins: [wildcardImports()]
})
import * as esbuild from 'esbuild'
import wildcardImports from 'esbuild-plugin-wildcard-imports'
await esbuild.build({
plugins: [
wildcardImports({
ignore: ['**/{build,dist}', '**/foo', '**/bar']
})
]
})
name | type | optional | notes |
---|---|---|---|
ignore | string[] |
yes | same semantics of fast-glob |