Babel 7 へのupgrade toolを使ってみたメモ
あくまで個人用メモ、備忘録的なものになります。
babel7がリリースされましたが、Babel7へのupgradeツールもリリースされています。
試しに自身のリポジトリに適用してみました。
全然更新できていない、todoアプリ。
react/reduxの練習用に、触りたての頃に作っていたもの。めっちゃ途中のまま放り出してしまっていた。。
npx babel-upgrade
を実行した場合、どれがアップロードされるかを 確認することができる。
"devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.0", + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-decorators": "^7.0.0", + "@babel/plugin-proposal-do-expressions": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-export-namespace-from": "^7.0.0", + "@babel/plugin-proposal-function-bind": "^7.0.0", + "@babel/plugin-proposal-function-sent": "^7.0.0", + "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-throw-expressions": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", + "babel-core": "^7.0.0-bridge.0", "babel-eslint": "^8.2.2", "babel-jest": "^22.4.1", - "babel-loader": "^7.1.2", - "babel-preset-env": "^1.6.1", - "babel-preset-react": "^6.24.1", - "babel-preset-stage-0": "^6.24.1", + "babel-loader": "^8.0.0",
下記のコマンドで実際にupgradeを行う。
npx babel-upgrade --write
試してみたリポジトリ上ではうまく行ったよう。
下記がそのときのコミット。