Skip to content

Commit 013d730

Browse files
authored
Merge pull request #6 from maciej-ka/add-rollup-plugin-flow
feat: add rollup-plugin-flow
2 parents 04aa671 + e806229 commit 013d730

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"rollup-plugin-bundle-size": "^1.0.1",
4545
"rollup-plugin-commonjs": "^8.2.6",
4646
"rollup-plugin-es3": "^1.1.0",
47+
"rollup-plugin-flow": "^1.1.1",
4748
"rollup-plugin-node-resolve": "^3.0.0",
4849
"rollup-plugin-nodent": "^0.1.3",
4950
"rollup-plugin-post-replace": "^1.0.0",

src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import es3 from 'rollup-plugin-es3';
1414
import gzipSize from 'gzip-size';
1515
import prettyBytes from 'pretty-bytes';
1616
import shebangPlugin from 'rollup-plugin-preserve-shebang';
17+
import flow from 'rollup-plugin-flow';
1718

1819
const readFile = promisify(fs.readFile);
1920
const stat = promisify(fs.stat);
@@ -43,7 +44,7 @@ export default async function microbundle(options) {
4344
options.input = [].concat(
4445
options.entries && options.entries.length ? options.entries : options.pkg.source || (await isDir(resolve(cwd, 'src')) && 'src/index.js') || (await isFile(resolve(cwd, 'index.js')) && 'index.js') || options.pkg.module
4546
).map( file => resolve(cwd, file) );
46-
47+
4748
let main = resolve(cwd, options.output || options.pkg.main || 'dist');
4849
if (!main.match(/\.[a-z]+$/) || await isDir(main)) {
4950
main = resolve(main, `${options.pkg.name}.js`);
@@ -163,6 +164,7 @@ function createConfig(options, entry, format) {
163164
input: entry,
164165
external,
165166
plugins: [
167+
flow({ all: true }),
166168
nodent({
167169
exclude: 'node_modules/**',
168170
noRuntime: true,
@@ -225,4 +227,4 @@ function createConfig(options, entry, format) {
225227
};
226228

227229
return config;
228-
}
230+
}

0 commit comments

Comments
 (0)