Skip to content

Commit d5942ee

Browse files
committed
introduce @babel/plugin-proposal-class-properties to support class member property
1 parent 976b663 commit d5942ee

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

babel.config.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
module.exports = {
2-
presets: [
2+
presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
3+
plugins: [
34
[
4-
'@babel/preset-env',
5+
'@babel/plugin-proposal-class-properties',
56
{
6-
targets: {
7-
node: 'current',
8-
},
7+
loose: true,
98
},
109
],
1110
],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"devDependencies": {
1414
"@babel/core": "^7.7.5",
15+
"@babel/plugin-proposal-class-properties": "^7.7.4",
1516
"@babel/preset-env": "^7.7.6",
1617
"babel-jest": "^24.9.0",
1718
"jest": "^24.9.0",

yarn.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,18 @@
5757
"@babel/traverse" "^7.7.4"
5858
"@babel/types" "^7.7.4"
5959

60+
"@babel/helper-create-class-features-plugin@^7.7.4":
61+
version "7.7.4"
62+
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz#fce60939fd50618610942320a8d951b3b639da2d"
63+
integrity sha512-l+OnKACG4uiDHQ/aJT8dwpR+LhCJALxL0mJ6nzjB25e5IPwqV1VOsY7ah6UB1DG+VOXAIMtuC54rFJGiHkxjgA==
64+
dependencies:
65+
"@babel/helper-function-name" "^7.7.4"
66+
"@babel/helper-member-expression-to-functions" "^7.7.4"
67+
"@babel/helper-optimise-call-expression" "^7.7.4"
68+
"@babel/helper-plugin-utils" "^7.0.0"
69+
"@babel/helper-replace-supers" "^7.7.4"
70+
"@babel/helper-split-export-declaration" "^7.7.4"
71+
6072
"@babel/helper-create-regexp-features-plugin@^7.7.4":
6173
version "7.7.4"
6274
resolved "https://registry.npm.taobao.org/@babel/helper-create-regexp-features-plugin/download/@babel/helper-create-regexp-features-plugin-7.7.4.tgz?cache=0&sync_timestamp=1574466720467&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-create-regexp-features-plugin%2Fdownload%2F%40babel%2Fhelper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59"
@@ -207,6 +219,14 @@
207219
"@babel/helper-remap-async-to-generator" "^7.7.4"
208220
"@babel/plugin-syntax-async-generators" "^7.7.4"
209221

222+
"@babel/plugin-proposal-class-properties@^7.7.4":
223+
version "7.7.4"
224+
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.4.tgz#2f964f0cb18b948450362742e33e15211e77c2ba"
225+
integrity sha512-EcuXeV4Hv1X3+Q1TsuOmyyxeTRiSqurGJ26+I/FW1WbymmRRapVORm6x1Zl3iDIHyRxEs+VXWp6qnlcfcJSbbw==
226+
dependencies:
227+
"@babel/helper-create-class-features-plugin" "^7.7.4"
228+
"@babel/helper-plugin-utils" "^7.0.0"
229+
210230
"@babel/plugin-proposal-dynamic-import@^7.7.4":
211231
version "7.7.4"
212232
resolved "https://registry.npm.taobao.org/@babel/plugin-proposal-dynamic-import/download/@babel/plugin-proposal-dynamic-import-7.7.4.tgz#dde64a7f127691758cbfed6cf70de0fa5879d52d"

0 commit comments

Comments
 (0)