stealjs / steal

Gets JavaScript
https://stealjs.com
MIT License
1.36k stars 522 forks source link

All CommonJS and AMD modules to be transpiled #1513

Open matthewp opened 4 years ago

matthewp commented 4 years ago

This enables AMD and CommonJS modules to also be transpiled (run through Babel). Still a little bit of a WIP. Closes #1276

matthewp commented 4 years ago

There are a few issues with this PR but it basically works. Also need to test against steal-tools as I'm not sure what the implications this might have on that.

matthewp commented 4 years ago

Need a way to test this. My thought:

Have a custom babel plugin. Maybe it could change a function signature in some way. We would know that it works by calling same function. For example:

module.exports = function() {
  return 1;
};

Transpiles to:

module.exports = function() {
  return 2;
};

But only for a certain module. Seems reasonable.