Can you share your full esbuild.config.js please? I am trying to get this working with Yarn 2. But with Yarn 2 PNP, I cannot run node esbuild.config.js in my project because packages resolving does not work when they are not present in node_modules. When I run node esbuild.config.mjs I get error Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'esbuild' imported from SNIP/esbuild.config.mjs
Never mind, I found the solution. The build must be started with yarn node esbuild.config.js so that dependencies are resolved using .pnp.cjs if yarn is configured to use PnP.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Can you share your full esbuild.config.js please? I am trying to get this working with Yarn 2. But with Yarn 2 PNP, I cannot run
node esbuild.config.jsin my project because packages resolving does not work when they are not present in node_modules. When I runnode esbuild.config.mjsI get error Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'esbuild' imported from SNIP/esbuild.config.mjsNever mind, I found the solution. The build must be started with
yarn node esbuild.config.jsso that dependencies are resolved using .pnp.cjs if yarn is configured to use PnP.