systemjs / plugin-babel

SystemJS Babel Plugin
MIT License
82 stars 33 forks source link

How to specify version of babel? #60

Closed ghempton closed 8 years ago

ghempton commented 8 years ago

I am currently getting hit by a named export hoisting issue using this plugin. I see that it has been fixed here: https://github.com/babel/babel/pull/3594. I am assuming that I am not using the latest version of babel and that is why I am seeing this locally. Is there a way to change the babel version that this plugin uses?

guybedford commented 8 years ago

Are you using the latest version of this plugin (0.0.14)?

ghempton commented 8 years ago

I am using master directly.

On Tue, Sep 13, 2016, 9:51 AM Guy Bedford notifications@github.com wrote:

Are you using the latest version of this plugin (0.0.14)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/systemjs/plugin-babel/issues/60#issuecomment-246747391, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAjIrX8A9MJRARGEj5PCuy4-KVJDX6Bks5qptSBgaJpZM4J4Tnj .

guybedford commented 8 years ago

Then you're definitely running the latest version of Babel with that fix. If you can perhaps share a reduced test case that would help to look into it further.

ghempton commented 8 years ago

Here is a simple case that causes the issue:

export function b(block) {
  return block.trim();
}

export function e(block, element) {
  return `${b(block)}__${element.trim()}`;
}

export function m(element, modifier) {
  return `${element.trim()}--${modifier.trim()}`;
}

export default function bem(block, element, modifier) {
  if (element && modifier) {
    return m(e(block, element), modifier);
  } else if (element) {
    return e(block, element);
  } else if (modifier) {
    return m(b(block), modifier);
  }
  return b(block);
}
ghempton commented 8 years ago

I think this is due to using an out of date presets package babel-preset-stage-0