Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: nodeResolve.customResolveOptions is a deprecated option in a Stencil Configuration file #6058

Closed
3 tasks done
johnc-ftl opened this issue Nov 25, 2024 · 4 comments
Closed
3 tasks done
Labels
ionitron: stale issue This issue has not seen any activity for a long period of time

Comments

@johnc-ftl
Copy link

Prerequisites

Stencil Version

4.22.3

Current Behavior

Using stencil config like:

export const config: Config = {
  namespace: 'web-components',
  tsconfig: 'tsconfig.lib.json',
  nodeResolve: {
    customResolveOptions: {
      moduleDirectory: [
        '../../dist/node_modules',
        '../../node_modules'
      ]
    }
  },
...

To use a local build output node_modules in addition to normal node_modules.

This works as expected, but I receive the following warning with each build:

[51:23.7]  @stencil/core
[51:24.0]  v4.22.3

[ WARN  ]  Build Warn
           nodeResolve.customResolveOptions is a deprecated option in a Stencil Configuration file. If you need this
           option, please open a new issue in the Stencil repository
           (https://github.com/ionic-team/stencil/issues/new/choose)

Expected Behavior

No warning.

System Info

  npx stencil info

      System: node 22.6.0
    Platform: windows (10.0.22631)
   CPU Model: 12th Gen Intel(R) Core(TM) i9-12900H (20 cpus)
    Compiler: C:\src\ftl\webui\node_modules\@stencil\core\compiler\stencil.js
       Build: 1732216626
     Stencil: 4.22.3
  TypeScript: 5.5.4
      Rollup: 2.56.3
      Parse5: 7.1.2
      jQuery: 4.0.0-pre
      Terser: 5.31.1

Steps to Reproduce

Create a stencil library with similar config to what I provided above.

Code Reproduction URL

https://github.com/johncrim/stencil

Additional Information

(This isn't a repro URL - I don't think one is required, the issue is straightforward)

@ionitron-bot ionitron-bot bot added the triage label Nov 25, 2024
@christian-bromann
Copy link
Member

@johnc-ftl thanks for raising this issue.

This field is used to configure @rollup/plugin-node-resolve when generating any non-documentation output target artifacts. the contents of this option get propagated by the rollup plugin to resolve, which does the actual resolution of files in stencil's in-memory filesystem. In newer versions of @rollup/plugin-node-resolve, this option has been removed, which no option to override defaults (creating a separation of concerns between the plugin and resolve).

To use a local build output node_modules in addition to normal node_modules.

Can you please elaborate on your use case and provide maybe a minimal example for this?

@johnc-ftl
Copy link
Author

Hi @christian-bromann - thank you for the explanation. I appreciate you all having the deprecation warning vs stopping working :)

Our use case is that we have some internal libraries, that we build first, and that our stencil project depends on. Those libraries write their build output to:

./dist/node_modules

whereas all the normal/external NPM dependencies are written to:

./node_modules.

The Stencil project has external and internal dependencies, thus the config above.

Are you aware of another way to configure dependency resolution to resolve from both directories? I'm happy to switch to another approach that works.

@christian-bromann
Copy link
Member

I am not sure what you mean when you say:

Those libraries write their build output to:

I assume you have a monorepo structure and compile the output into that directory. If that is the case I recommend to use a package manager like pnpm that allows you to seamlessly link your mono repo package and have it just work.

Is my consumption correct or is it a different scenario?

@ionitron-bot ionitron-bot bot added the ionitron: stale issue This issue has not seen any activity for a long period of time label Jan 5, 2025
Copy link

ionitron-bot bot commented Jan 5, 2025

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out.

Thank you for using Stencil!

@ionitron-bot ionitron-bot bot closed this as completed Jan 5, 2025
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jan 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: stale issue This issue has not seen any activity for a long period of time
Projects
None yet
Development

No branches or pull requests

2 participants