Skip to content

Commit

Permalink
feat(api): publish package with Flow annotations built in
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The Draft.js filters now come with [Flow](https://flow.org/) annotations. For projects that do not use Flow this has no impact. For Flow users, please make sure you correctly type your code so Flow doesn't raise issues because of conflicts with this package's type definitions.
  • Loading branch information
thibaudcolas committed Sep 28, 2018
1 parent 054ffed commit 7a813cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import babel from "rollup-plugin-babel"
import pkg from "./package.json"

const BANNER = `// @flow
/*:: import type { ContentState } from "draft-js"*/`

export default [
{
input: "src/lib/index.js",
external: ["draft-js"],
output: [
{ file: pkg.main, format: "cjs" },
{ file: pkg.module, format: "es" },
{ file: pkg.main, format: "cjs", banner: BANNER },
{ file: pkg.module, format: "es", banner: BANNER },
],
plugins: [
babel({
Expand All @@ -20,8 +23,8 @@ export default [
modules: false,
},
],
"flow",
],
plugins: ["transform-flow-comments"],
}),
],
},
Expand Down

0 comments on commit 7a813cc

Please sign in to comment.