Webpack paths in a streaming error

I am trying to set up Flow in a new project, but my ways of solving web packages confuse it. I automatically allow root folders to use components/Foo instead of ../../../Components/Foo .

Is there any way around this? I tried playing with module.name_mapper= '^components/[a-zA-Z0-9$_]+$' -> 'src/components' , but that did not work.

 src/pages/Login.js:5 5: import View from 'components/View'; ^^^^^^^^^^^^^^^^^ components/View. Required module not found 
+5
source share
1 answer

This is now supported by jeffmo. This supports module resolution features in webpack.

 [options] module.name_mapper='^components\(.*\)$' -> '<PROJECT_ROOT>/components/\1' module.name_mapper='^actions\(.*\)$' -> '<PROJECT_ROOT>/actions/\1' module.name_mapper='^containers\(.*\)$' -> '<PROJECT_ROOT>/containers/\1' 

https://github.com/facebook/flow/issues/382

https://github.com/cdebotton/react-universal/commit/e57aadbcbd8be4e2031f308187392f44d02b44f9

+3
source

Source: https://habr.com/ru/post/1233933/


All Articles