Skip to content

Eazymov/vite-plugin-flow

Repository files navigation

vite-plugin-flow

npm License PRs Welcome

Flow support for Vite

Installation

# npm
npm i vite-plugin-flow -D

# yarn
yarn add vite-plugin-flow -D

# pnpm
pnpm add vite-plugin-flow -D
// vite.config.js
import vitePluginFlow from 'vite-plugin-flow'

export default {
  plugins: [vitePluginFlow()],
}

Options

export type Options = $ReadOnly<{|
  /*
    Which files to parse with flow
    default: /\.jsx?$/
  */
  filter?: RegExp,
  /*
    If true, bypasses looking for an @flow pragma comment before parsing.
    default: false
  */
  all?: boolean,
  /*
    If true, removes types completely rather than replacing with spaces.
    This may require using source maps.
    default: false
  */
  pretty?: boolean,
  /*
    If true, removes uninitialized class fields (`foo;`, `foo: string;`)
    completely rather than only removing the type. THIS IS NOT SPEC
    COMPLIANT! Instead, use `declare foo: string;` for type-only fields.
    default: false
  */
  ignoreUninitializedFields?: boolean,
|}>

Questions

If you have any troubles, questions or proposals you can create the issue

License

MIT (c) 2021 - present, Eazymov