Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
husayt authored Apr 5, 2019
1 parent fafe105 commit 9c428fb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ yarn add nuxt-property-decorator
```
### Nuxt JS Instructions
Currently decorators need the following two Babel plugins to work `@babel/plugin-proposal-decorators`,`"@babel/plugin-proposal-class-properties`. Latest Nuxt already adds them for us, the only thing we need is to add `loose` parameter to `@nuxt/babel-preset-app`. Just add this to nuxt-config
```js

~~.
build: {
babel: {
presets({ isServer }) {
return [
Expand All @@ -43,8 +45,18 @@ Currently decorators need the following two Babel plugins to work `@babel/plug
]
}
}
```

}~~ (as there is an issue with @nuxt/babel-preset-ap, meanwhile just use the following config)

```js
build: {
babel: {
plugins: [
["@babel/plugin-proposal-decorators", { legacy: true }],
["@babel/plugin-proposal-class-properties", { loose: true }]
]
}
}
```
### Nuxt TS Instructions
It works out of the box with Nuxt TS.

Expand Down

0 comments on commit 9c428fb

Please sign in to comment.