Options
All
  • Public
  • Public/Protected
  • All
Menu

Package esbuild-plugin-pnp

@yarnpkg/esbuild-plugin-pnp

This plugin lets you use Yarn with esbuild. We use it in order to build Yarn itself!

Usage

Add the plugin to your dependencies:

yarn add @yarnpkg/esbuild-plugin-pnp

Reference it via your esbuild configuration (build API only):

import {pnpPlugin} from '@yarnpkg/esbuild-plugin-pnp';

await build({ plugins: [pnpPlugin()], // ... });

Type aliases

External

External: string | object

OnResolveParams

OnResolveParams: object

Type declaration

  • Optional error?: Error
  • resolvedPath: string | null

PluginOptions

PluginOptions: object

Type declaration

  • Optional baseDir?: undefined | string
  • Optional extensions?: Array<string>
  • Optional filter?: RegExp
  • Optional onLoad?: undefined | function
  • Optional onResolve?: undefined | function

Variables

Const defaultExtensions

defaultExtensions: string[] = [`.tsx`, `.ts`, `.jsx`, `.mjs`, `.cjs`, `.js`, `.css`, `.json`]

Const matchAll

matchAll: RegExp = /()/

Functions

defaultOnLoad

  • defaultOnLoad(args: OnLoadArgs): Promise<OnLoadResult>

defaultOnResolve

  • defaultOnResolve(args: OnResolveArgs, __namedParameters: object): Promise<OnResolveResult>

isExternal

  • isExternal(path: string, externals: Array<External>): boolean

parseExternals

  • parseExternals(externals: Array<string>): Array<External>

pnpPlugin

  • pnpPlugin(__namedParameters?: object): Plugin
  • Parameters

    • Default value __namedParameters: object = {}
      • baseDir: string
      • extensions: string[]
      • filter: RegExp
      • onLoad: function
          • (args: OnLoadArgs): Promise<OnLoadResult>
          • Parameters

            • args: OnLoadArgs

            Returns Promise<OnLoadResult>

      • onResolve: function
          • (args: OnResolveArgs, params: OnResolveParams): Promise<OnResolveResult | null>
          • Parameters

            Returns Promise<OnResolveResult | null>

    Returns Plugin

Generated using TypeDoc