Webpack loader used to auto generate css-module token exports, in order to allow flow to check that you're using correct properties on the generated style object.
Generates type definitions for imported style files, which allows flow to type-check "against" the imported style object.
npm install css-module-flow-gen-loader
This can be used with any CSS module format such as .styl, .scss, .sass, or .pcss. All that's required is that css-module-flow-gen-loader is placed after the css-loader.
[
...,
{
test: /\.scss$/,
use: [
'style-loader',
'css-module-flow-gen-loader',
{
loader: 'css-loader',
options: {
modules: true,
camelCase: true,
localIdentName: '[name]_[local]_[hash:base64:5]'
},
},
{
loader: 'sass-loader'
}
]
}
]
Define allowed file import for flow.
[options]
module.file_ext=.js
module.file_ext=.json
module.file_ext=.scss