Skip to content

Commit

Permalink
Merge pull request #23 from lijunle/readme-usage
Browse files Browse the repository at this point in the history
Add the usage section in README.
  • Loading branch information
59naga committed Jan 22, 2016
2 parents 0cbd7e6 + 6cd4a8f commit c7665bc
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,38 @@ Therefore, our old codes still work fine - the `.default` goes away. :wink:
require('./bundle.js') // foo
```

Usage
---

Install this plugin from npm:

```sh
npm install babel-plugin-add-module-exports --save-dev
```

Write the name to [babelrc](https://babeljs.io/docs/usage/babelrc/). It works with [preset-es2015](http://babeljs.io/docs/plugins/preset-es2015/) to output CommonJS code:

```json
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
]
}
```

It also works with [transform-es2015-modules-umd](http://babeljs.io/docs/plugins/transform-es2015-modules-umd/) plugin to output UMD code: (It is a *must* to place UMD plugin *after* this plugin.)

```json
{
"presets": ["es2015"],
"plugins": [
"add-module-exports",
"transform-es2015-modules-umd"
]
}
```

License
---
[MIT](http://59naga.mit-license.org/)

0 comments on commit c7665bc

Please sign in to comment.