Update docs
This commit is contained in:
parent
fdad51b53b
commit
ef21724a9c
@ -66,7 +66,7 @@ export function bar() {
|
|||||||
**Out**
|
**Out**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
define("filename", ["exports", "foo"], function (exports, _foo) {
|
define(["exports", "foo"], function (exports, _foo) {
|
||||||
exports.bar = bar;
|
exports.bar = bar;
|
||||||
|
|
||||||
var foo = _foo.default;
|
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
|
### UMD
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
@ -94,7 +100,7 @@ export function bar() {
|
|||||||
```javascript
|
```javascript
|
||||||
(function (factory) {
|
(function (factory) {
|
||||||
if (typeof define === "function" && define.amd) {
|
if (typeof define === "function" && define.amd) {
|
||||||
define("filename", ["exports", "foo"], factory);
|
define(["exports", "foo"], factory);
|
||||||
} else if (typeof exports !== "undefined") {
|
} else if (typeof exports !== "undefined") {
|
||||||
factory(exports, require("foo"));
|
factory(exports, require("foo"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,6 +123,11 @@ to5.transformFile("filename.js", options, function (err, result) {
|
|||||||
// Default: `sourceRoot` option.
|
// Default: `sourceRoot` option.
|
||||||
moduleRoot: "my-app",
|
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
|
// Optionally replace all 6to5 helper declarations with a referenece to this
|
||||||
// variable. If set to `true` then the default namespace is used "to5Runtime".
|
// variable. If set to `true` then the default namespace is used "to5Runtime".
|
||||||
// Default: false
|
// Default: false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user