From f3e7cf33f6853afd12ac9cb75649a9c38ed609cf Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Wed, 22 Apr 2020 14:40:34 +0200 Subject: [PATCH] Run tsconfig paths resolver before PnP Based on https://github.com/zeit/next.js/pull/11293#issuecomment-617745204 Not sure how to test PnP and couldn't figure out how to debug packages installed through PnP. We'll have to update this either way as PnP is going to be built into webpack 5 and that would change the order to be like this too. --- packages/next/build/webpack-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index 9bb275b6b557..09cb57595c18 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -1014,7 +1014,7 @@ export default async function getBaseWebpackConfig( } if (jsConfig?.compilerOptions?.paths && resolvedBaseUrl) { - webpackConfig.resolve?.plugins?.push( + webpackConfig.resolve?.plugins?.unshift( new JsConfigPathsPlugin(jsConfig.compilerOptions.paths, resolvedBaseUrl) ) }