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(
export const NODE_RESOLVE_OPTIONS = {
dependencyType: 'commonjs',
modules: ['node_modules'],
alias: false,
fallback: false,
exportsFields: ['exports'],
importsFields: ['imports'],
......@@ -197,13 +196,24 @@ export const NODE_RESOLVE_OPTIONS = {
restrictions: [],
}
export const NODE_BASE_RESOLVE_OPTIONS = {
...NODE_RESOLVE_OPTIONS,
alias: false,
}
export const NODE_ESM_RESOLVE_OPTIONS = {
...NODE_RESOLVE_OPTIONS,
alias: false,
dependencyType: 'esm',
conditionNames: ['node', 'import'],
fullySpecified: true,
}
export const NODE_BASE_ESM_RESOLVE_OPTIONS = {
...NODE_ESM_RESOLVE_OPTIONS,
alias: false,
}
let TSCONFIG_WARNED = false
export default async function getBaseWebpackConfig(
......@@ -808,7 +818,7 @@ export default async function getBaseWebpackConfig(
let baseIsEsm: boolean
try {
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)
} 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