0.0.15 • Published 2 months ago

esbuild-plugin-wildcard-imports v0.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Coverage report


Limitations & Known issues

  • Only works with platform=node and bundle=true

  • The majority of the automated tests covers format=cjs

  • Dynamic imports with top-level await won't work with format=cjs

FAQ

  • 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.
  • 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.

Behaviors


Instalation

pnpm add esbuild-plugin-wildcard-imports --save-dev
yarn add esbuild-plugin-wildcard-imports --dev
npm install esbuild-plugin-wildcard-imports --save-dev

Usage examples

Basic use

import * as esbuild from 'esbuild'
import wildcardImports from 'esbuild-plugin-wildcard-imports'

await esbuild.build({
  plugins: [wildcardImports()]
})

With custom ignore patterns

import * as esbuild from 'esbuild'
import wildcardImports from 'esbuild-plugin-wildcard-imports'

await esbuild.build({
  plugins: [
    wildcardImports({
      ignore: ['**/{build,dist}', '**/foo', '**/bar']
    })
  ]
})

Options

nametypeoptionalnotes
ignorestring[]yessame semantics of fast-glob

Some examples where the plugin applies

  • CommonJS

  • ESM export aggregation

  • ESM import and re-export

  • ESM Dynamic Import

0.0.15

2 months ago

0.0.14

2 months ago

0.0.10

2 months ago

0.0.11

2 months ago

0.0.12

2 months ago

0.0.13

2 months ago

0.0.9

2 months ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.5

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago

0.0.1

2 months ago