1

Coming from previous question Typescript creating modules.

I have created module outside node_modules folder and phpstorm does not pickup where is the library.

It does compile and does run fine, but type hint does not pickup, which causes issues when developing.

type-hint

If I put my module inside node_modules, then it picks up automatically, else it shows error as above.

How can I tell type hint of phpstorm where is my module outside node_modules?

1 Answer 1

0

I can't see where your from part is on that line, but I'm guessing since this works when everything is in node_modules that you must have forgot the ./ part.

Import looks in node_modules when your from looks like this:

 import * from 'something_in_node_modules';

If you add ./ in front of the file location, it will look in the current directory you're in.

For example:

 import * from './some-ts-file-in-this-directory';

Try that, and it should fix the problem!

Sign up to request clarification or add additional context in comments.

4 Comments

How can I use import * from 'something_in_note_modules_OR_another_folder?
If you're using weback you could do some conditionals in the import. Why not import both?
Or do you mean import { Something, Another } from 'somenodemodule';
I mean import libraries from two different location one is node_module folder and another some other folder. how can I add another folder on webpack.. following is my file pastie.org/10760617

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.