Skip to content
Discussion options

You must be logged in to vote

You solution is right

It is not working if resolve.extensions is not defined.

Can you clarify?

Yes, this is expected, it is too later modify global options, because default options already applied (short answer).

Long answer - resolver is more complex than you could think. We have concept of byDependency resolver, i.e. resolving for commonjs, esm, css are different (and use different options) so our code doing this stuff:

/** @type {function(): ResolveOptions} */
const jsExtensions = [".js", ".json", ".wasm"];

const esmDeps = () => ({
  aliasFields: browserField ? ["browser"] : [],
  mainFields: browserField ? ["browser", "module", "..."] : ["module", "..."],
  conditionNames: ["import", 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@krutoo
Comment options

Answer selected by krutoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants