Parcel: feature request: Flow

Created on 28 Dec 2017  路  4Comments  路  Source: parcel-bundler/parcel

Does Parcel support stripping Flow types from code?

Question

Most helpful comment

Thanks Brandon!

All 4 comments

This would be handled by Babel, which parcel will run for you automatically. To strip flow types:

# Install Babel Transform
npm install --save-dev babel-plugin-transform-flow-strip-types
// Add to .babelrc
{
  "plugins": ["transform-flow-strip-types"]
}

Reference: https://babeljs.io/docs/plugins/transform-flow-strip-types/

Thanks Brandon!

This is production error in js file. :fu:
error :hocho:

index.js

// @flow

export interface BaseAction {
  type: string;
}

export interface Action<Payload> extends BaseAction {
  +payload: Payload;
  error?: boolean;
}

export interface ActionMeta<Payload, Meta> extends Action<Payload> {
  meta: Meta;
}

export type Dispatch = (action: Action<*> | Promise<Action<*>>) => Promise<*>;

@FDiskas Show babel config.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidnagli picture davidnagli  路  3Comments

medhatdawoud picture medhatdawoud  路  3Comments

466023746 picture 466023746  路  3Comments

davidnagli picture davidnagli  路  3Comments

Niggler picture Niggler  路  3Comments