How to make IntelliJ IDEA resolve webpack requires out of node_modules directory?

前端 未结 1 1321
挽巷
挽巷 2021-01-01 15:45

IntelliJ cannot resolve javascript modules called with webpack requires which are not inside the node_modules directory

Imagine this project structure:<

相关标签:
1条回答
  • 2021-01-01 16:25

    I think this should work (or so it did in my case anyway).

    In IntelliJ:

    1. Open the project
    2. File > Project Structure
    3. On the left hand side, select Modules
    4. From your directory structure, select the folders where your sources are (util and src) and mark them as Resources
    5. Click Apply

    You should have code completion and documentation available now.

    0 讨论(0)
提交回复
热议问题