catamphetamine / webpack-isomorphic-tools

Server-side rendering for your Webpack-built applications (e.g. React)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolving webpack custom module paths

mnowotnik opened this issue · comments

Just wanted to share my solution to the problem I encountered with additional module paths
in my webpack config.
Imports like:
import MyComponent from 'src/components/MyComponent';
are resolved by webpack using the resolve.modules option.

webpack-isomorphic-tools cannot resolve those paths by its own. To enable
custom modules resolution simply set up babel-plugin-module-resolver exactly as in Readme.

Oh, resolving via Babel is really the right way to go.
I see more and more older hacks being removed via babel plugins.
Elegant enough.