Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 3ba5bd1

Browse files
committed
document 6to5 support
1 parent 701dca6 commit 3ba5bd1

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,22 @@ For an example of a universal module loader based on this polyfill for loading A
2828

2929
### Getting Started
3030

31-
If using ES6 syntax (optional), include `traceur.js` in the page first then include `es6-module-loader.js`:
31+
If using ES6 syntax (optional), include `traceur.js` or `6to5.js` in the page first then include `es6-module-loader.js`:
3232

3333
```html
3434
<script src="traceur.js"></script>
3535
<script src="es6-module-loader.js"></script>
3636
```
3737

38-
Write an ES6 module:
38+
To use 6to5, set the parser to `6to5` with the loader configuration:
39+
40+
```html
41+
<script>
42+
System.parser = '6to5';
43+
</script>
44+
```
45+
46+
Then we can write any ES6 module:
3947

4048
mymodule.js:
4149
```javascript
@@ -46,7 +54,7 @@ mymodule.js:
4654
}
4755
```
4856

49-
We can then load the module with the dynamic loader:
57+
and load the module dynamically in the browser
5058

5159
```html
5260
<script>
@@ -86,6 +94,11 @@ For use in NodeJS, the `Loader` and `System` globals are provided as exports:
8694
index.js:
8795
```javascript
8896
var System = require('es6-module-loader').System;
97+
/*
98+
* Include:
99+
* System.parser = '6to5';
100+
* to use 6to5 instead of Traceur
101+
*/
89102

90103
System.import('some-module').then(function(m) {
91104
console.log(m.p);
@@ -132,7 +145,7 @@ Note: you will need to export your username and key to launch it.
132145
```
133146

134147
## Credit
135-
Copyright (c) 2014 Luke Hoban, Addy Osmani, Guy Bedford
148+
Copyright (c) 2015 Luke Hoban, Addy Osmani, Guy Bedford
136149

137150
## License
138151
Licensed under the MIT license.

0 commit comments

Comments
 (0)