fivetanley / ember-cli-migrator

migrate your files to the standard ember-cli structure, preserving git history
MIT License
106 stars 22 forks source link

Commonjs export support #52

Closed rauhryan closed 9 years ago

rauhryan commented 9 years ago

Adds a check for the commonjs export syntax and uses that to declare the name of es6 export

closes #51 when merged

:warning: not ready for pull in yet :warning:

@fivetanley looking to get some early feedback on this as soon as you can

Thanks!

rauhryan commented 9 years ago

Ok, basic commonjs support is working

basically it does two things

  1. walks the nodes looking for a module.exports = Foo and replaces that with exports default Foo;
  2. walks the nodes looking for var Foo = require('path/to/foo') and replaces that with import Foo from '/app/path/to/foo'
fivetanley commented 9 years ago

Thanks! this is in 0.7! and on npm!