Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
馃摎 Add installation and usage in README
- Loading branch information
1 parent
6c3c4bd
commit 8d31825
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,40 @@ | ||
# babel-plugin-transform-typescript-metadata | ||
|
||
[![Travis (.com)](https://img.shields.io/travis/com/leonardfactory/babel-plugin-transform-typescript-metadata.svg)](https://travis-ci.com/leonardfactory/babel-plugin-transform-typescript-metadata) | ||
[![Codecov](https://img.shields.io/codecov/c/github/leonardfactory/babel-plugin-transform-typescript-metadata.svg)](https://codecov.io/gh/leonardfactory/babel-plugin-transform-typescript-metadata) | ||
[![npm](https://img.shields.io/npm/v/babel-plugin-transform-typescript-metadata.svg?style=popout)](https://www.npmjs.com/package/babel-plugin-transform-typescript-metadata) | ||
|
||
Babel plugin to emit decorator metadata like typescript compiler | ||
|
||
## Installation | ||
|
||
With npm: | ||
|
||
```sh | ||
npm install --dev --save babel-plugin-transform-typescript-metadata | ||
``` | ||
|
||
or with Yarn: | ||
|
||
```sh | ||
yarn add --dev babel-plugin-transform-typescript-metadata | ||
``` | ||
|
||
## Usage | ||
|
||
With `.babelrc`: | ||
|
||
> **Note:** should be placed **before** `@babel/plugin-proposal-decorators`. | ||
```js | ||
{ | ||
"plugins": [ | ||
"babel-plugin-transform-typescript-metadata", | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
["@babel/plugin-proposal-class-properties", { "loose": true }], | ||
], | ||
"presets": [ | ||
"@babel/preset-typescript" | ||
] | ||
} | ||
``` |