Skip to content

Instantly share code, notes, and snippets.

@christiannaths
Last active October 8, 2017 19:59
Show Gist options
  • Save christiannaths/5a350272cecfdd3db8bab90b02954c6b to your computer and use it in GitHub Desktop.
Save christiannaths/5a350272cecfdd3db8bab90b02954c6b to your computer and use it in GitHub Desktop.
Webpack: avoid relative import paths by symlinking a shortcut
@bermanboris
Copy link

Instruction won't work on Windows, because command for creating symlinks is different.


Mac/Linux: ln -s ../ src/node_modules/@
Windows: mklink /d ../ src/node_modules/@

I think that's the only difference.

@christiannaths
Copy link
Author

It looks like there is a slightly more official way to do this facebook/create-react-app#476

Besides differences with Windows, importing from a symlink seems to break Jest. So probably better to use the NODE_PATH method as described in the link above, rather than this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment