Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/torifat/flowtype-loader
Flow loader for webpack
https://github.com/torifat/flowtype-loader
Last synced: 2 months ago
JSON representation
Flow loader for webpack
- Host: GitHub
- URL: https://github.com/torifat/flowtype-loader
- Owner: torifat
- License: mit
- Created: 2016-08-02T21:32:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T00:38:12.000Z (over 6 years ago)
- Last Synced: 2024-08-09T18:16:08.919Z (5 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 87
- Watchers: 5
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flow - flowtype-loader - Flow loader for webpack. (Tools)
README
# flowtype-loader
[Flow](https://flowtype.org/) loader for [webpack](https://webpack.js.org/)
## Install
```sh
$ npm install --save-dev flowtype-loader
```OR, for lazy people like me:
```sh
$ npm i -D flowtype-loader
```## Usage
In your webpack `2.X` configuration:
```js
var FlowtypePlugin = require('flowtype-loader/plugin');module.exports = {
// ...
module: {
rules: [
{test: /\.js$/, loader: 'flowtype-loader', enforce: 'pre', exclude: /node_modules/},
]
},
plugins: [
new FlowtypePlugin()
// new FlowtypePlugin({cwd: '/path/'})
// new FlowtypePlugin({failOnError: true})
]
// ...
}
```If you are using webpack `1.x`:
```js
var FlowtypePlugin = require('flowtype-loader/plugin');module.exports = {
// ...
module: {
preLoaders: [
{test: /\.js$/, loader: "flowtype", exclude: /node_modules/}
]
},
plugins: [
new FlowtypePlugin()
// new FlowtypePlugin({cwd: '/path/'})
// new FlowtypePlugin({failOnError: true})
]
// ...
}
```