This package has been deprecated

Author message:

unsupported

flow-bin-loader

1.0.3 • Public • Published

flow-bin-loader

npm version

A webpack loader built around flow-bin to enforce type checking with Flow.

Installation

$ npm install --save-dev flow-bin flow-bin-loader

Usage

Add the plugin to your webpack config as follows:

module: {
  rules: [
    {
      test: /\.jsx?$/,
      loader: 'flow-bin-loader',
      exclude: /node_modules/,
      enforce: 'pre',
    }
  ]
},

Don't forget to add // @flow to the top of the files you want to be checked.

Configuration

By default, modules are resolved with respect to the directory where .flowconfig lives, so you might need to tell Flow how to map paths to the correct directory.

In order to do that, create a file named .flowconfig in the root directory of your project and add a module mapper rule such as the one below.

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

For the complete list of options, visit https://flowtype.org/docs/advanced-configuration.html

Package Sidebar

Install

npm i flow-bin-loader

Weekly Downloads

33

Version

1.0.3

License

MIT

Unpacked Size

3.46 kB

Total Files

4

Last publish

Collaborators

  • brunocodutra