Skip to content

Instantly share code, notes, and snippets.

@kitze
Created October 3, 2016 12:11
Show Gist options
  • Save kitze/63ac677fbd70bda72d10756e6e0d3d87 to your computer and use it in GitHub Desktop.
Save kitze/63ac677fbd70bda72d10756e6e0d3d87 to your computer and use it in GitHub Desktop.
create-react-app + custom-react-scripts configuration for Flowtype
[ignore]
.*/node_modules/fbjs/.*
.*/node_modules/react-event-listener/.*
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
esproposal.decorators=ignore
unsafe.enable_getters_and_setters=true
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=src
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='less' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='css' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/file-stub.js'
@oliverturner
Copy link

Nice! Only difference with my set-up is that instead of '<PROJECT_ROOT>/file-stub.js' I'm using https://www.npmjs.com/package/empty

module.name_mapper='.*\.css$' -> 'empty/object'

@alexeygolev
Copy link

I think since 0.32 you don't have to provide module_mappers
https://github.com/facebook/flow/releases/tag/v0.32.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment