Unverified Commit 8ee61278 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update resolve options for nft (#29524)

Follow-up to https://github.com/vercel/next.js/pull/29473 after additional testing it seems we need to ensure the `main` field is used when tracing packages during builds so that `module` isn't being used unexpectedly. 
parent 2f26fb44
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
isWebpack5, isWebpack5,
sources, sources,
} from 'next/dist/compiled/webpack/webpack' } from 'next/dist/compiled/webpack/webpack'
import { NODE_RESOLVE_OPTIONS } from '../../webpack-config'
const PLUGIN_NAME = 'TraceEntryPointsPlugin' const PLUGIN_NAME = 'TraceEntryPointsPlugin'
const TRACE_IGNORES = [ const TRACE_IGNORES = [
...@@ -352,7 +353,12 @@ export class TraceEntryPointsPlugin implements webpack.Plugin { ...@@ -352,7 +353,12 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
) )
} }
) )
const resolver = compilation.resolverFactory.get('normal') let resolver = compilation.resolverFactory.get('normal')
resolver = resolver.withOptions({
...NODE_RESOLVE_OPTIONS,
extensions: undefined,
})
const doResolve = async ( const doResolve = async (
request: string, request: string,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment