Skip to content

Instantly share code, notes, and snippets.

@inPhoenix
Last active June 1, 2019 18:47
Show Gist options
  • Save inPhoenix/36005f18bbe78c1360ef205e968005af to your computer and use it in GitHub Desktop.
Save inPhoenix/36005f18bbe78c1360ef205e968005af to your computer and use it in GitHub Desktop.
PhpStorm / WebStorm Custom Import Paths

PhpStorm - Import - Relative Thread: https://intellij-support.jetbrains.com/hc/en-us/community/posts/207656825-Custom-import-paths-with-es6 Steps: Configuration based on create-react-app:

.env file
NODE_PATH=src/

PhpStorm/Webstorm:

Mark src directory as Resource Root
Go to Settings -> Editor -> Code Style -> Javascript.
Switch to Imports tab and select Use paths relative to the project, resource or sources root.

______[imports](tab)
[ ]
[x] Use paths relative to project, resource or sources roots.
[ ]

Common mistake: 
Don't mark the 'src' folder as directory Resource Root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment