Skip to content

Commit

Permalink
fix(optimizer): pnp compat to match relative paths (#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreBonaventure committed Jan 25, 2021
1 parent 36857fc commit 8fb74f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite/src/node/optimizer/esbuildDepPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ export function esbuildDepPlugin(

// yarn 2 pnp compat
if (isRunningWithYarnPnp) {
build.onResolve({ filter: /\.yarn.*/ }, (args) => ({
build.onResolve({ filter: /.*/ }, (args) => ({
path: require.resolve(args.path, { paths: [args.resolveDir] })
}))
build.onLoad({ filter: /\.yarn.*/ }, async (args) => ({
build.onLoad({ filter: /.*/ }, async (args) => ({
contents: await require('fs').promises.readFile(args.path),
loader: 'default'
}))
Expand Down

0 comments on commit 8fb74f5

Please sign in to comment.