19
14

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.

Laravel-mix で、IE11に対応させる

Last updated at Posted at 2017-05-23

Laravel-mixでは最初から設定されていると思い、していなかった。
IE11を使っている人からの問い合わせで気付いた。

下記の手順を踏めば、IE11対応するはず。

yarn add -D babel-polyfill babel-preset-es2015
.babelrc
{
  "presets": [
    "es2015",
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["> 2%"],
        "uglify": true
      }
    }]
  ]
}
webpack.mix.js
const { mix } = require('laravel-mix')

mix.options({
  polyfills: [
    'Promise'
  ]
})
// ...
resources/assets/js/app.js
// ...
require('babel-polyfill')
// ...

参考

https://github.com/JeffreyWay/laravel-mix/issues/564
https://github.com/JeffreyWay/laravel-mix/issues/436

19
14
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
19
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?