diff --git a/doc/modules.md b/doc/modules.md index 781900a167..ff655c5119 100644 --- a/doc/modules.md +++ b/doc/modules.md @@ -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")); } diff --git a/doc/usage.md b/doc/usage.md index 02c845469b..3fd2d4f10e 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -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