How to fix problems with esbuild in Yarn

ippatev

Aleksandr Ippatev

Posted on August 10, 2021

How to fix problems with esbuild in Yarn

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

  1. Add the plugin to your dependencies:
yarn add @yarnpkg/esbuild-plugin-pnp
Enter fullscreen mode Exit fullscreen mode
  1. Reference it via your esbuild configuration build API only:
import {pnpPlugin} from '@yarnpkg/esbuild-plugin-pnp';

await build({
  plugins: [pnpPlugin()],
  // ...
});
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
ippatev
Aleksandr Ippatev

Posted on August 10, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related