Use remove-flow-types directly

This commit is contained in:
Kushan Joshi
2018-03-14 13:17:50 -04:00
parent 3d57d1b0d6
commit e1e4cb1df5
2 changed files with 13 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ const commonjs = require('rollup-plugin-commonjs');
const json = require('rollup-plugin-json');
const includePaths = require('rollup-plugin-includepaths');
const colors = require('colors/safe');
const flow = require('rollup-plugin-flow');
const flowRemoveTypes = require('flow-remove-types');
module.exports = function buildSrc() {
@@ -72,4 +72,16 @@ function unlink(f) {
try {
fs.unlinkSync(f);
} catch (e) { /* noop */ }
}
// Using this instead of rollup-plugin-flow due to
// https://github.com/leebyron/rollup-plugin-flow/issues/5
function flow() {
return {
name: 'flow-remove-types',
transform: (code) => ({
code: flowRemoveTypes(code).toString(),
map: null
})
};
}

View File

@@ -69,7 +69,6 @@
"request": "^2.85.0",
"rollup": "~0.56.3",
"rollup-plugin-commonjs": "^9.0.0",
"rollup-plugin-flow": "^1.1.1",
"rollup-plugin-includepaths": "^0.2.2",
"rollup-plugin-json": "^2.2.0",
"rollup-plugin-node-resolve": "^3.2.0",