-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added flow to babel cli #10244
added flow to babel cli #10244
Conversation
I re-created my changes from the latest master branch. I don't know what changes I need to make to make the CI checks pass. |
Test is good as long as Travis CI passes. Sometimes CircleCI returns flaky result. |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11224/ |
packages/babel-cli/src/babel/file.js
Outdated
@@ -65,7 +76,7 @@ export default async function({ cliOptions, babelOptions }) { | |||
babelOptions.sourceMaps === "inline" || | |||
(!cliOptions.outFile && babelOptions.sourceMaps) | |||
) { | |||
code += "\n" + convertSourceMap.fromObject(map).toComment(); | |||
code += "\n" + convertSourceMap.fromObject(map.toJSON()).toComment(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toJSON()
will incur extra Object memory allocation here.
Given that convertSourceMap
can work with SourceMapGenerator
to generate a base64 comment, I would suggest we extend the signature of fromObject
to state that it can work with SourceMapGenerator
.
babel/lib/third-party-libs.js.flow
Line 180 in fced5ce
fromObject(obj: SourceMap): Converter, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. I can make that change.
Added flow to the babel-cli package.