LoginSignup
3
1

More than 5 years have passed since last update.

babel-preset-latestからbabel-preset-envへ

Last updated at Posted at 2018-06-12

手順

まずはコマンドでアンインストールとインストール

npm uninstall babel-preset-latest --save-dev
npm install babel-preset-env --save-dev

npmのルートディレクトリ(gulpfile.jsやpackage.jsonがあるディレクトリ)に
.babelrcという設定ファイルがあるので以下のように変更。

{
  "presets": ["latest"]
}



{
  "presets": ["env"]
}

背景

https://www.npmjs.com/package/babel-preset-latest
に行ったら廃止と書かれていたので乗り換えました。
.babelrcの存在を忘れていたので備忘録的にメモ。

自分の環境では無事es6(class構文なども含め)からコンパイルされ動作しました。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1