scalableminds / amd-optimize

An AMD (RequireJS) optimizer that's stream-friendly. Made for gulp.
MIT License
162 stars 29 forks source link

Support usage of module shortcuts. #33

Closed mlb6 closed 9 years ago

mlb6 commented 9 years ago

I had a problem using amd-optimize because I was using some shortcuts to access to some module in my code. In the config file I got some declaration like this :

{
  paths : {
    "core" : "path/to/lib/core"
  }
}

So when I want to access to path/to/lib/core/MyModule.js I just need to use it like this:

define("core/MyModule", function(myModule){
});

This is working with requireJS without optimization, but it was not working with amd-optimize. I'm not sure it is a good way to use requireJS (even if it works). It is the first time I write code with coffee script. So, please, review my code before merging it.

normanrz commented 9 years ago

Thanks for making this PR. This has been a long-standing issue (#30). Your implementation works very well. I modified a couple of tests and published a new version to npm.