Enable .? and ?? operator with Babel

This commit is contained in:
sienori 2022-03-02 21:35:55 +09:00
parent b20bfe1698
commit 3aa3a28a07
3 changed files with 55 additions and 1 deletions

View file

@ -10,5 +10,5 @@ module.exports = {
], ],
"@babel/preset-react" "@babel/preset-react"
], ],
plugins: ["@babel/plugin-proposal-object-rest-spread", "transform-class-properties"] plugins: ["@babel/plugin-proposal-nullish-coalescing-operator", "@babel/plugin-syntax-optional-chaining", "@babel/plugin-proposal-object-rest-spread", "transform-class-properties"]
}; };

52
package-lock.json generated
View file

@ -324,6 +324,24 @@
"@babel/plugin-syntax-json-strings": "^7.0.0" "@babel/plugin-syntax-json-strings": "^7.0.0"
} }
}, },
"@babel/plugin-proposal-nullish-coalescing-operator": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz",
"integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.16.7",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3"
},
"dependencies": {
"@babel/helper-plugin-utils": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
"integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
"dev": true
}
}
},
"@babel/plugin-proposal-object-rest-spread": { "@babel/plugin-proposal-object-rest-spread": {
"version": "7.9.6", "version": "7.9.6",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.6.tgz",
@ -436,6 +454,23 @@
"@babel/helper-plugin-utils": "^7.0.0" "@babel/helper-plugin-utils": "^7.0.0"
} }
}, },
"@babel/plugin-syntax-nullish-coalescing-operator": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz",
"integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.8.0"
},
"dependencies": {
"@babel/helper-plugin-utils": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
"integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
"dev": true
}
}
},
"@babel/plugin-syntax-object-rest-spread": { "@babel/plugin-syntax-object-rest-spread": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz",
@ -454,6 +489,23 @@
"@babel/helper-plugin-utils": "^7.0.0" "@babel/helper-plugin-utils": "^7.0.0"
} }
}, },
"@babel/plugin-syntax-optional-chaining": {
"version": "7.8.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz",
"integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.8.0"
},
"dependencies": {
"@babel/helper-plugin-utils": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
"integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
"dev": true
}
}
},
"@babel/plugin-transform-arrow-functions": { "@babel/plugin-transform-arrow-functions": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz",

View file

@ -14,8 +14,10 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.0.0-beta.49", "@babel/core": "^7.0.0-beta.49",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
"@babel/plugin-proposal-object-rest-spread": "^7.9.6", "@babel/plugin-proposal-object-rest-spread": "^7.9.6",
"@babel/plugin-syntax-jsx": "^7.2.0", "@babel/plugin-syntax-jsx": "^7.2.0",
"@babel/plugin-syntax-optional-chaining": "^7.8.3",
"@babel/preset-env": "^7.0.0-beta.49", "@babel/preset-env": "^7.0.0-beta.49",
"@babel/preset-react": "^7.0.0-beta.49", "@babel/preset-react": "^7.0.0-beta.49",
"babel-loader": "^8.0.0-beta.3", "babel-loader": "^8.0.0-beta.3",