6to5/6to5 — pull request #176 by darvelo (2014-11-16 07:53:43+00:00)
Title: Generate moduleNames for AMD/UMD

references #158, references #44

This PR allows for generating user-defined module names for AMD and UMD.

Users can define a root prefix for each module, which allows for more flexible application routing (e.g. `js-client/moduleA`) and can strip the source file's directory root so that module names can are relative (e.g. module name is `moduleA` rather than `/home/user/myApp/es6/moduleA`).

This meant a couple of new user-defined opts, which for now I've named:

* `sourceRoot` - the JS source directory to be stripped from the path
* `moduleRoot` - an optional prefix for each module. I've got a couple of lines for `gulp-6to5` for this part that I will submit a PR for if these changes look good to go. For `gulp-6to5` the changeset would be something like this:

```js
try {
var fileOpts = objectAssign({}, opts, {
filename: file.path,
+ filenameRelative: file.relative,
sourceMap: !!file.sourceMap
});
```

Let me know what you think! :wink: