meteor / babel

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

remove meteor preset from defaults, so order can be set in .babelrc #10

Closed gadicc closed 8 years ago

gadicc commented 8 years ago

(to discuss post-1.3)

If you want to use, say, the transform-decorator plugin, it has to be loaded before the meteor preset. But not just for that reason, I think this is the right way to go regardless, since:

  1. Consistent babel settings for non-Meteor tools, e.g. wallaby.
  2. Ability to fine tune exact plugins rather than use the entire Meteor preset, if someone really wants.

So now in meteor-react-hotloader's babel-compiler at least we:

  1. Create .babelrc if it doesn't already exist with a skeleton
  2. Assert that { presets: "meteor" } exists.

i.e. https://github.com/gadicc/meteor-react-hotloader/blob/master/babel-compiler-hot/babelrc.js

meteor-babel / babel-compiler will still conditionally add the jscript plugins based on target, we'll have to think about that. For now I left react in there too, even though it's now used for everything and should probably be in .babelrc too.

gadicc commented 8 years ago

And of course, if we do this, we need another way to make sure it's up-to-date, i.e.:

  var checkNpmVersions = Package['tmeasday:check-npm-versions'].checkNpmVersions;
  checkNpmVersions({
    'babel-preset-meteor': '^6.6.7'
  }, 'babel-compiler');

Still plan to move react out too.

gadicc commented 8 years ago

Addressed in Meteor 1.3.3.