Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Commit 7f748be

Browse files
committed
Merge pull request #21 from yahoo/babel-6
Update to work with Babel 6
2 parents 34d069b + 968fc66 commit 7f748be

File tree

4 files changed

+113
-136
lines changed

4 files changed

+113
-136
lines changed

.babelrc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"stage": 4,
3-
"optional": [
4-
"runtime",
5-
"es7.objectRestSpread"
2+
"presets": [
3+
"es2015"
4+
],
5+
"plugins": [
6+
"transform-object-rest-spread",
7+
"transform-runtime"
68
]
79
}

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ The default message descriptors for the app's default language will be extracted
2222

2323
```json
2424
{
25-
"plugins": ["react-intl"],
26-
"extra": {
27-
"react-intl": {
25+
"plugins": [
26+
["react-intl", {
2827
"messagesDir": "./build/messages/",
2928
"enforceDescriptions": true
30-
}
31-
}
29+
}]
30+
]
3231
}
3332
```
3433

@@ -51,8 +50,8 @@ $ babel --plugins react-intl script.js
5150
The extract message descriptors are available via the `metadata` property on the object returned from Babel's `transform()` API:
5251

5352
```javascript
54-
require("babel-core").transform("code", {
55-
plugins: ["react-intl"]
53+
require('babel-core').transform('code', {
54+
plugins: ['react-intl']
5655
}) // => { code, map, ast, metadata['react-intl'].messages };
5756
```
5857

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@
1515
"mkdirp": "^0.5.1"
1616
},
1717
"devDependencies": {
18-
"babel": "^5.8.21",
19-
"babel-eslint": "^4.1.2",
20-
"eslint": "^1.4.3"
18+
"babel-cli": "^6.1.18",
19+
"babel-eslint": "^4.1.5",
20+
"babel-plugin-transform-object-rest-spread": "^6.1.18",
21+
"babel-plugin-transform-runtime": "^6.1.18",
22+
"babel-preset-es2015": "^6.1.18",
23+
"eslint": "^1.9.0",
24+
"rimraf": "^2.4.3"
2125
},
2226
"scripts": {
2327
"lint": "eslint src/",
24-
"build": "babel-plugin build",
25-
"push": "babel-plugin publish",
26-
"test": "babel-plugin test",
27-
"prepublish": "npm run lint && npm run build"
28+
"clean": "rimraf lib/",
29+
"build": "babel src/ --out-dir lib/",
30+
"prepublish": "npm run lint && npm run clean && npm run build"
2831
},
2932
"keywords": [
3033
"babel-plugin",

0 commit comments

Comments
 (0)