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

Open
3 tasks done
johnc-ftl opened this issue Nov 25, 2024 · 2 comments
Open
3 tasks done

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants