0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

webpack + babel の開発環境でIE対応させる

Last updated at Posted at 2018-12-07

まず babel-polyfill をインストール。

yarn add @babel/polyfill

その次に webpack.babel.config.js の entry の項目を以下のように修正

// 修正前
entry: {
        test: './src/test/main.js'
}

// 修正後
entry: {
        test: ['@babel/polyfill', './src/test/main.js']
}

これでトランスパイルすればIEなどES6対応していないブラウザのサポート完了。

詳細は公式ページ

Polyfillは prototype を上書きしたりするため使用にはいくらか注意が必要。問題点などはこの記事によくまとめられている。

0
3
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
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?