I'm trying to setup Flow in a new project but my webpack resolve paths are confusing it. I am resolving root folders automatically so that you can use components/Foo
instead of ../../../Components/Foo
.
Is there a way around this? I tried playing with module.name_mapper= '^components/[a-zA-Z0-9$_]+$' -> 'src/components'
but it didn't work.
src/pages/Login.js:5
5: import View from 'components/View';
^^^^^^^^^^^^^^^^^ components/View. Required module not found
This is now supported thanks to jeffmo. This supports module resolution functionality 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With