# ... | |
[options] | |
# webpack loaders | |
module.name_mapper='.*\.css$' -> '<PROJECT_ROOT>/flow/stub/css-modules.js' | |
module.name_mapper='.*\.\(svg\|png\|jpg\|gif\)$' -> '<PROJECT_ROOT>/flow/stub/url-loader.js' |
// @flow | |
type CSSModule = { [key: string]: string } | |
const emptyCSSModule: CSSModule = {} | |
export default emptyCSSModule |
// @flow | |
const s: string = "" | |
export default s |
This comment has been minimized.
This comment has been minimized.
@MoOx you're an absolute legend :) thanks so much for being such a huge help! |
This comment has been minimized.
This comment has been minimized.
Followed exactly but doesn't seem to be working. What version of flow are you using? latest version 0.28 or something else? @MoOx |
This comment has been minimized.
This comment has been minimized.
@tonyxiao, I was able to yield the expected result w/ v0.28. |
This comment has been minimized.
This comment has been minimized.
I think you should just declare types instead of exporting actual objects. CssStub.js /* @flow */
declare export default {[key: string]: string}; FileStub.js /* @flow */
declare export default string; |
This comment has been minimized.
This comment has been minimized.
Also, .flowconfig module.name_mapper='^!raw!.*$' -> '<PROJECT_ROOT>/flow/stub/url-loader.js'
module.name_mapper='.*\.css$' -> '<PROJECT_ROOT>/flow/stub/css-modules.js' However, when I had the same config, just with |
This comment has been minimized.
Explained at https://stackoverflow.com/questions/36912675/flow-required-module-not-found/37272883#37272883