Skip to content

Inline resolver options are ingored when loading modules #124

@witq

Description

@witq

Hi,

I've been trying to use inline resolver options when loading modules and noticed that setting the register property did nothing. I looked at load-modules.ts and it seemes that inline resolver options are ignored when constructing the final regOpts object:

const regOpts: BuildResolver<any> = {
  ...opts.resolverOptions,
  ...moduleDescriptorOpts
}

I changed it to treat inline options as the final component of the object, overwriting any previously set options and it worked flawlessly - my module's export has been registered asValue, as declared in the inline resolver options.
The changed regOpts look like this:

const regOpts: BuildResolver<any> = {
  ...opts.resolverOptions,
  ...moduleDescriptorOpts,
  ...inlineConfig
}

Since I'm not sure if this is by design and I'm having massive issues with setting up the environment for contributing, I'm opening an issue instead of a pull request.

Please let me know if this is something that you'd want a PR for. And thank you for this library - great use of proxies and a joy to work with 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions