Add CLI commands for module docs
This commit is contained in:
parent
063b379d4f
commit
5db757354a
@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
### CLI
|
### CLI
|
||||||
|
|
||||||
$ 6to5 --modules common script.js
|
```sh
|
||||||
|
$ 6to5 --modules common script.js
|
||||||
|
```
|
||||||
|
|
||||||
### Node
|
### Node
|
||||||
|
|
||||||
@ -17,13 +19,17 @@ to5.transform('import "foo";', { modules: "common" });
|
|||||||
|
|
||||||
* [AMD](#amd)
|
* [AMD](#amd)
|
||||||
* [Common (Default)](#common-default)
|
* [Common (Default)](#common-default)
|
||||||
* [Common](#common)
|
* [Common Interop](#common-interop)
|
||||||
* [Ignore](#ignore)
|
* [Ignore](#ignore)
|
||||||
* [System](#system)
|
* [System](#system)
|
||||||
* [UMD](#umd)
|
* [UMD](#umd)
|
||||||
|
|
||||||
### Common (Default)
|
### Common (Default)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ 6to5 --modules common
|
||||||
|
```
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -60,6 +66,10 @@ exports.default = test;
|
|||||||
|
|
||||||
### Common interop
|
### Common interop
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ 6to5 --modules commonInterop
|
||||||
|
```
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -123,6 +133,10 @@ function foo() {
|
|||||||
|
|
||||||
### AMD
|
### AMD
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ 6to5 --modules amd
|
||||||
|
```
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -155,6 +169,10 @@ define("filename", ["exports", "foo"], function (exports, _foo) {})
|
|||||||
|
|
||||||
### UMD
|
### UMD
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ 6to5 --modules umd
|
||||||
|
```
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -187,6 +205,10 @@ export function bar() {
|
|||||||
|
|
||||||
### Ignore
|
### Ignore
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ 6to5 --modules ignore
|
||||||
|
```
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -207,6 +229,10 @@ function bar() {
|
|||||||
|
|
||||||
### System
|
### System
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ 6to5 --modules system
|
||||||
|
```
|
||||||
|
|
||||||
**In**
|
**In**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@ -244,7 +270,9 @@ System.register("bar", ["foo"], function (_export) {
|
|||||||
|
|
||||||
You can alternatively specify module names instead of one of the built-in types.
|
You can alternatively specify module names instead of one of the built-in types.
|
||||||
|
|
||||||
$ 6to5 --modules custom-module-formatter
|
```sh
|
||||||
|
$ 6to5 --modules custom-module-formatter
|
||||||
|
```
|
||||||
|
|
||||||
**node_modules/custom-module-formatter/index.js**
|
**node_modules/custom-module-formatter/index.js**
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user