Unverified Commit 15822516 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

fixes #29553 (#29611)



fixes #29553

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
parent 92c2dd49
...@@ -179,7 +179,6 @@ export function attachReactRefresh( ...@@ -179,7 +179,6 @@ export function attachReactRefresh(
export const NODE_RESOLVE_OPTIONS = { export const NODE_RESOLVE_OPTIONS = {
dependencyType: 'commonjs', dependencyType: 'commonjs',
modules: ['node_modules'], modules: ['node_modules'],
alias: false,
fallback: false, fallback: false,
exportsFields: ['exports'], exportsFields: ['exports'],
importsFields: ['imports'], importsFields: ['imports'],
...@@ -197,13 +196,24 @@ export const NODE_RESOLVE_OPTIONS = { ...@@ -197,13 +196,24 @@ export const NODE_RESOLVE_OPTIONS = {
restrictions: [], restrictions: [],
} }
export const NODE_BASE_RESOLVE_OPTIONS = {
...NODE_RESOLVE_OPTIONS,
alias: false,
}
export const NODE_ESM_RESOLVE_OPTIONS = { export const NODE_ESM_RESOLVE_OPTIONS = {
...NODE_RESOLVE_OPTIONS, ...NODE_RESOLVE_OPTIONS,
alias: false,
dependencyType: 'esm', dependencyType: 'esm',
conditionNames: ['node', 'import'], conditionNames: ['node', 'import'],
fullySpecified: true, fullySpecified: true,
} }
export const NODE_BASE_ESM_RESOLVE_OPTIONS = {
...NODE_ESM_RESOLVE_OPTIONS,
alias: false,
}
let TSCONFIG_WARNED = false let TSCONFIG_WARNED = false
export default async function getBaseWebpackConfig( export default async function getBaseWebpackConfig(
...@@ -808,7 +818,7 @@ export default async function getBaseWebpackConfig( ...@@ -808,7 +818,7 @@ export default async function getBaseWebpackConfig(
let baseIsEsm: boolean let baseIsEsm: boolean
try { try {
const baseResolve = getResolve( const baseResolve = getResolve(
isEsm ? NODE_ESM_RESOLVE_OPTIONS : NODE_RESOLVE_OPTIONS isEsm ? NODE_BASE_ESM_RESOLVE_OPTIONS : NODE_BASE_RESOLVE_OPTIONS
) )
;[baseRes, baseIsEsm] = await baseResolve(dir, request) ;[baseRes, baseIsEsm] = await baseResolve(dir, request)
} catch (err) { } catch (err) {
......
throw new Error('Should not be executed')
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