Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@brillout/import

brillout258kMIT0.2.6TypeScript support: included

Usage:

readme

Usage:

import { import_ } from '@brillout/import'

// Same as `import()`
const module = await import_(moduleName)

Same as import() but:

  • Avoids bundlers from bundling moduleName, such as Webpack or Cloudflare Workers's wrangler bundler.
  • Avoids TypeScript from transpiling import() to require().
  • Fixes Node.js windows bug ERR_UNSUPPORTED_ESM_URL_SCHEME.

Zero dependency. (And doesn't dependend on any Node.js API.)