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

Imports module not from nested #66

Open
wclr opened this issue Nov 22, 2018 · 2 comments
Open

Imports module not from nested #66

wclr opened this issue Nov 22, 2018 · 2 comments

Comments

@wclr
Copy link

wclr commented Nov 22, 2018

Clone, run and test:

https://github.com/whitecolor/tsconfig-paths-issues

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["./node_modules/*"]
    }
  }
}
  "dependencies": {
    "tsconfig-paths": "^3.7.0",
    "plugin-error": "^1.0.1",
    "webpack-log": "^2.0.0"
  }

webpack-log module gives an error:

TypeError: Cannot read property 'info' of undefined

webpack-log imports ansi-colors from ./node_modules/ansi-colors not from nested ./node_modules/webpack-log/node_modules/ansi-colors

I'm not sure how it should work with this config by design, but what I want is to specify an additional location for finding node_modules. Here is kind of dummy example, because "*": ["./node_modules/*"] makes no actual sense as this location is included anyway. But this could be different (for example some where in nested folder), and anyway module should first try to require modules from its own "node_modules" first then go up, and only then would search for other locations.

So what I need again:
inside say some module parent
require('mod')

  1. would try parent/node_modules
  2. go up node_modules tree
  3. only then would try locations described inside tsconfig "paths"

Is it possible, or how it should work?

@typeofweb
Copy link

@whitecolor did you find a solution to this problem?

@wclr
Copy link
Author

wclr commented Oct 28, 2019

@whitecolor did you find a solution to this problem?

Yes. Decided not to use tsconfig-paths -) To simplify things now I use only yarn workspaces to get rid of relative addresses.

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