React-redux-universal-hot-example: Why NODE_PATH?

Created on 10 Mar 2016  路  2Comments  路  Source: erikras/react-redux-universal-hot-example

I noticed NODE_PATH is assigned to ./src in package.json. Why is this necessary?

Most helpful comment

I believe that specifying this adds that path as a valid root for absolute import statements.

E.G. import SurveyForm from "components" works because the file lives in ~/src/components and we've specified ./src as a valid start point so it will successfully find /components without a relative URL

All 2 comments

I believe that specifying this adds that path as a valid root for absolute import statements.

E.G. import SurveyForm from "components" works because the file lives in ~/src/components and we've specified ./src as a valid start point so it will successfully find /components without a relative URL

Ah ok, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sauravskumar picture sauravskumar  路  6Comments

yesmeck picture yesmeck  路  3Comments

Dt-dev28 picture Dt-dev28  路  3Comments

eromoe picture eromoe  路  5Comments

capir picture capir  路  4Comments