Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
Update readme for 6.14.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel15 committed Aug 27, 2016
1 parent 8a523fc commit 4e45680
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Installation

There are several ways to get a copy of babel-standalone. Pick whichever one you like:

- Use it via CDNJS: https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.10.3/babel.min.js. This is a simple way to embed it on a webpage without having to do any other setup.
- Use it via CDNJS: https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.14.0/babel.min.js. This is a simple way to embed it on a webpage without having to do any other setup.
- Install via Bower: `bower install babel-standalone`
- Install via NPM: `npm install --save babel-standalone`
- Manually grab `babel.js` and/or `babel.min.js` from the [GitHub releases page](https://github.com/Daniel15/babel-standalone/releases). Every release includes these files.
Expand All @@ -38,12 +38,22 @@ When loaded in a browser, babel-standalone will automatically compile and execut
```html
<div id="output"></div>
<!-- Load Babel -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.10.3/babel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.14.0/babel.min.js"></script>
<!-- Your custom script here -->
<script type="text/babel">
const getMessage = () => "Hello World";
document.getElementById('output').innerHTML = getMessage();
</script>
```

You can use the `data-plugins` and `data-presets` attributes to specify the Babel plugins/presets to use:
```html
<script type="text/babel" data-presets="es2015,stage2">
```
Loading external scripts via `src` attribute is supported too:
```html
<script type="text/babel" src="foo.js"></script>
```

Note that `.babelrc` doesn't work in babel-standalone, as no file system access is available. The presets and/or plugins to use **must** be specified in the options passed to `Babel.transform`.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-standalone",
"version": "6.13.2",
"version": "6.14.0",
"description": "Standalone build of Babel for use in non-Node.js environments. Similar to the (now deprecated) babel-browser",
"main": "babel.js",
"scripts": {
Expand Down

0 comments on commit 4e45680

Please sign in to comment.