Skip to content
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

How to transpile index.js with broccoli-babel-transpiler #121

Closed
ppcano opened this issue Nov 5, 2015 · 4 comments
Closed

How to transpile index.js with broccoli-babel-transpiler #121

ppcano opened this issue Nov 5, 2015 · 4 comments

Comments

@ppcano
Copy link
Contributor

ppcano commented Nov 5, 2015

I am importing ember-resolver in a non ember-cli project.

But I had some problems with the index.js which is using syntax-export-extensions to make it work with the broccoli-babel-transpiler.

May anybody point me in the direction on how to transpile this syntax with the broccoli-babel-transpiler project, I reviewed the ember-cli code but I could not find any information.

@stefanpenner
Copy link
Contributor

I'm surprised, i think export { default } isn't new, but other variations with very similar syntax are.

Im not sure how to do this in babel 6, and in babel 5 it "just works"

@rwjblue
Copy link
Member

rwjblue commented Nov 6, 2015

Some details in rwjblue/ember-twiddle@3fc82f0

@ppcano
Copy link
Contributor Author

ppcano commented Nov 6, 2015

@stefanpenner you were right, the syntax just works with babel 5.

The problem was that I was using broccoli-es6-module-transpiler to convert to AMD modules.

  result = babel(result, {
    loose: true
  });
  result = es6Filter(result, {moduleName: function(filePath) {
    return filePath.replace(/.js$/, '');
  }});

It works when using @rwjblue example.

  result = babel(result, {
    loose: true,
    moduleIds: true,
    modules: 'amdStrict'
  });

Thanks to both of you for the help.

@ppcano ppcano closed this as completed Nov 6, 2015
@stefanpenner
Copy link
Contributor

@ppcano :)

Maybe the options you are providing to babel should be an example in the broccoli-babel-transpiler readme. Seems like a very common combination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants