Webpack tip: add `modulesDirectories: [‘src’, ‘node_modules’]` to your resolve option in your…
Travis Arnold

From experience, be careful with this since it makes your modules not portable if you need to require them outside of your webpack build (i.e. tests, server-side stuff, etc.)

Another approach I’ve seen recommended (though haven’t tried it myself) is to add a symlink in your node_modules directory to your app, then require things like `import foo from ‘app/components/foo’`. This only sucks if you need to do dev on Windows.

Like what you read? Give Cina Saffary a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.