Skip to content

Commit b55ae94

Browse files
committed
Fix sourcemaps!
1 parent d8d2bf0 commit b55ae94

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@
4343
"camelcase": "^4.1.0",
4444
"chalk": "^2.3.0",
4545
"es6-promisify": "^5.0.0",
46+
"exorcist": "^1.0.0",
4647
"glob": "^7.1.2",
4748
"gzip-size": "^4.1.0",
4849
"pretty-bytes": "^4.0.2",
4950
"regenerator-runtime": "^0.11.1",
50-
"rollup": "^0.54.0",
51+
"rollup": "^0.55.0",
5152
"rollup-plugin-buble": "^0.18.0",
5253
"rollup-plugin-bundle-size": "^1.0.1",
5354
"rollup-plugin-commonjs": "^8.2.6",
5455
"rollup-plugin-es3": "^1.1.0",
5556
"rollup-plugin-flow": "^1.1.1",
5657
"rollup-plugin-node-resolve": "^3.0.2",
5758
"rollup-plugin-nodent": "^0.1.3",
58-
"rollup-plugin-postcss": "^1.1.0",
59-
"rollup-plugin-preserve-shebang": "^0.1.4",
59+
"rollup-plugin-postcss": "^1.2.6",
60+
"rollup-plugin-preserve-shebang": "^0.1.6",
6061
"rollup-plugin-sizes": "^0.4.2",
61-
"rollup-plugin-typescript": "^0.8.1",
6262
"rollup-plugin-strict-alias": "^1.0.0",
63+
"rollup-plugin-typescript": "^0.8.1",
6364
"rollup-plugin-uglify": "^2.0.1",
6465
"sade": "^1.3.1",
6566
"typescript": "^2.6.2",
@@ -68,7 +69,7 @@
6869
"devDependencies": {
6970
"babel-cli": "^6.26.0",
7071
"babel-preset-env": "^1.6.1",
71-
"eslint": "^4.15.0",
72+
"eslint": "^4.16.0",
7273
"eslint-config-developit": "^1.1.1",
7374
"fs-extra": "^5.0.0",
7475
"jest": "^22.1.4",

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ import alias from 'rollup-plugin-strict-alias';
1717
import gzipSize from 'gzip-size';
1818
import prettyBytes from 'pretty-bytes';
1919
import shebangPlugin from 'rollup-plugin-preserve-shebang';
20-
import flow from 'rollup-plugin-flow';
2120
import typescript from 'rollup-plugin-typescript';
21+
import flow from './lib/flow-plugin';
22+
// import exorcist from 'exorcist';
2223
import camelCase from 'camelcase';
2324

2425
const interopRequire = m => m.default || m;
2526
const readFile = promisify(fs.readFile);
27+
// const writeFile = promisify(fs.writeFile);
2628
const stat = promisify(fs.stat);
2729
const isDir = name => stat(name).then( stats => stats.isDirectory() ).catch( () => false );
2830
const isFile = name => stat(name).then( stats => stats.isFile() ).catch( () => false );
@@ -214,7 +216,7 @@ function createConfig(options, entry, format, writeMeta) {
214216
extract: !!writeMeta
215217
}),
216218
useTypescript && typescript(),
217-
!useTypescript && flow({ all: true }),
219+
!useTypescript && flow({ all: true, pretty: true }),
218220
nodent({
219221
exclude: 'node_modules/**',
220222
noRuntime: true,

src/lib/flow-plugin.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import flow from 'rollup-plugin-flow';
2+
3+
export default function fixedFlow(options) {
4+
let plugin = flow(options);
5+
return Object.assign({}, plugin, {
6+
transform(code, id) {
7+
let ret = plugin.transform(code, id);
8+
if (ret.code===code) return null;
9+
return ret;
10+
}
11+
});
12+
}

0 commit comments

Comments
 (0)