Update docs

This commit is contained in:
Lars Kappert 2014-11-19 08:52:33 +01:00
parent fdad51b53b
commit ef21724a9c
2 changed files with 13 additions and 2 deletions

View File

@ -66,7 +66,7 @@ export function bar() {
**Out**
```javascript
define("filename", ["exports", "foo"], function (exports, _foo) {
define(["exports", "foo"], function (exports, _foo) {
exports.bar = bar;
var foo = _foo.default;
@ -77,6 +77,12 @@ define("filename", ["exports", "foo"], function (exports, _foo) {
});
```
You can optionally specify to include the module id (using the `--amd-module-id` argument):
```javascript
define("filename", ["exports", "foo"], function (exports, _foo) {})
```
### UMD
**In**
@ -94,7 +100,7 @@ export function bar() {
```javascript
(function (factory) {
if (typeof define === "function" && define.amd) {
define("filename", ["exports", "foo"], factory);
define(["exports", "foo"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require("foo"));
}

View File

@ -123,6 +123,11 @@ to5.transformFile("filename.js", options, function (err, result) {
// Default: `sourceRoot` option.
moduleRoot: "my-app",
// If truthy, insert an explicit id for each defined AMD module.
// By default, AMD modules are anonymous.
// Default: false
amdModuleId: true,
// Optionally replace all 6to5 helper declarations with a referenece to this
// variable. If set to `true` then the default namespace is used "to5Runtime".
// Default: false