systemjs / plugin-babel

SystemJS Babel Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to specify version of babel?

ghempton opened this issue · comments

I am currently getting hit by a named export hoisting issue using this plugin. I see that it has been fixed here: babel/babel#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?

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

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
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAjIrX8A9MJRARGEj5PCuy4-KVJDX6Bks5qptSBgaJpZM4J4Tnj
.

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.

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);
}

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