meteor / babel

Babel wrapper package for use with Meteor
Other
46 stars 20 forks source link

Allow to disable sourceMap generation #36

Closed sebakerckhof closed 3 years ago

sebakerckhof commented 3 years ago

@filipenevola This is an updated version of: https://github.com/meteor/babel/pull/23 . Which I think is still valuable for some plugins that use meteor-babel

filipenevola commented 3 years ago

Great @sebakerckhof, let's move this forward.

I believe you need to change the tests to don't expect source maps in this case, this test is breaking:

1) should compose source maps correctly

sebakerckhof commented 3 years ago

So I think this actually also fixes a bug, since before the default option is to not have sourceMaps, but it is ignored. However, this should still be backwards compatible since all places where the default options is used in Meteor explicitly enable sourceMaps (although it didn't matter before this PR, hence why I believe this fixes a bug):

https://github.com/meteor/meteor/blob/d9db4f52f2ea6d706a25156768ea42e1fbb8f599/packages/babel-compiler/babel-compiler.js#L127 https://github.com/meteor/meteor/blob/444f8228b8a46d1035095d606933893e1873b8c3/tools/isobuild/builder.js#L371 https://github.com/meteor/meteor/blob/d9db4f52f2ea6d706a25156768ea42e1fbb8f599/packages/ecmascript/ecmascript.js#L7 https://github.com/meteor/meteor/blob/d9db4f52f2ea6d706a25156768ea42e1fbb8f599/tools/tool-env/install-babel.js#L19

I also check for the old name (sourceMap) since this is still being used in the coffeescript package (although it's set to true, so shouldn't really matter either): https://github.com/meteor/meteor/blob/d9db4f52f2ea6d706a25156768ea42e1fbb8f599/packages/non-core/coffeescript-compiler/coffeescript-compiler.js#L38