Skip to content

Commit 75300c4

Browse files
committed
Upgrade babel to 7. Remove transform classes plugin.
1 parent 4d6a71e commit 75300c4

File tree

3 files changed

+5627
-17
lines changed

3 files changed

+5627
-17
lines changed

.babelrc

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,45 @@
11
{
22
"plugins": [
3-
"add-module-exports",
3+
"@babel/plugin-transform-flow-strip-types",
44
"lodash",
5-
"transform-class-properties",
5+
"@babel/plugin-proposal-class-properties",
6+
"@babel/plugin-transform-proto-to-assign",
7+
"@babel/plugin-syntax-dynamic-import",
8+
"@babel/plugin-syntax-import-meta",
9+
"@babel/plugin-proposal-json-strings",
610
[
7-
"transform-es2015-classes",
11+
"@babel/plugin-proposal-decorators",
812
{
9-
"loose": true
13+
"legacy": true
1014
}
1115
],
12-
"transform-proto-to-assign"
16+
"@babel/plugin-proposal-function-sent",
17+
"@babel/plugin-proposal-export-namespace-from",
18+
"@babel/plugin-proposal-numeric-separator",
19+
"@babel/plugin-proposal-throw-expressions",
20+
"@babel/plugin-proposal-export-default-from",
21+
"@babel/plugin-proposal-logical-assignment-operators",
22+
"@babel/plugin-proposal-optional-chaining",
23+
[
24+
"@babel/plugin-proposal-pipeline-operator",
25+
{
26+
"proposal": "minimal"
27+
}
28+
],
29+
"@babel/plugin-proposal-nullish-coalescing-operator",
30+
"@babel/plugin-proposal-do-expressions",
31+
"@babel/plugin-proposal-function-bind"
1332
],
1433
"presets": [
15-
"es2015",
16-
"stage-0",
17-
"react"
34+
[
35+
"@babel/preset-env",
36+
{
37+
"modules": false,
38+
"targets": {
39+
"esmodules": true
40+
}
41+
}
42+
],
43+
"@babel/preset-react"
1844
]
1945
}

package.json

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,31 @@
2525
"object-unfreeze": "^1.1.0"
2626
},
2727
"devDependencies": {
28-
"babel-cli": "^6.18.0",
28+
"@babel/cli": "^7.0.0",
29+
"@babel/core": "^7.0.0",
30+
"@babel/plugin-proposal-class-properties": "^7.0.0",
31+
"@babel/plugin-proposal-decorators": "^7.0.0",
32+
"@babel/plugin-proposal-do-expressions": "^7.0.0",
33+
"@babel/plugin-proposal-export-default-from": "^7.0.0",
34+
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
35+
"@babel/plugin-proposal-function-bind": "^7.0.0",
36+
"@babel/plugin-proposal-function-sent": "^7.0.0",
37+
"@babel/plugin-proposal-json-strings": "^7.0.0",
38+
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
39+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
40+
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
41+
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
42+
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
43+
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
44+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
45+
"@babel/plugin-syntax-import-meta": "^7.0.0",
46+
"@babel/plugin-transform-flow-strip-types": "^7.2.3",
47+
"@babel/plugin-transform-proto-to-assign": "^7.0.0",
48+
"@babel/preset-env": "^7.0.0",
49+
"@babel/preset-react": "^7.0.0",
50+
"@babel/register": "^7.0.0",
2951
"babel-plugin-add-module-exports": "^0.2.1",
3052
"babel-plugin-lodash": "^3.2.9",
31-
"babel-plugin-transform-proto-to-assign": "^6.9.0",
32-
"babel-preset-es2015": "^6.18.0",
33-
"babel-preset-react": "^6.16.0",
34-
"babel-preset-stage-0": "^6.16.0",
35-
"babel-register": "^6.18.0",
3653
"chai": "^4.0.0-canary.1",
3754
"chai-spies": "^0.7.1",
3855
"eslint": "^3.10.0",
@@ -48,8 +65,7 @@
4865
},
4966
"scripts": {
5067
"lint": "eslint ./src ./tests",
51-
"test": "NODE_ENV=development mocha --compilers js:babel-register ./tests/**/*.js && npm run lint && npm run build",
52-
"build": "NODE_ENV=production babel ./src --out-dir ./dist",
53-
"precommit": "npm run test"
68+
"test": "NODE_ENV=development mocha --compilers js:@babel/register ./tests/**/*.js && npm run lint && npm run build",
69+
"build": "NODE_ENV=production babel ./src --out-dir ./dist"
5470
}
5571
}

0 commit comments

Comments
 (0)