Rails x Vue x Graphql x webpackerの IE11対応
自分用のメモ
Graphql (Apollo) の実行に 下記が必要。 たぶん fetch するため
isomorphic-unfetch
yarn add isomorphic-unfetch
app/javascript/packs/application.js に下記を追加
import "core-js/stable"; import "regenerator-runtime/runtime"; import 'isomorphic-unfetch'
async / await で import "regenerator-runtime/runtime"; が必要らしい
babel.config.js
presets: [ isTestEnv && [ '@babel/preset-env', { targets: { node: 'current' }, useBuiltIns: 'usage', } ], (isProductionEnv || isDevelopmentEnv) && [ '@babel/preset-env', { forceAllTransforms: true, useBuiltIns: 'entry', corejs: 3, modules: false, exclude: ['transform-typeof-symbol'] } ] ]
感想
IE対応はそろそろ終わりにしたい。
関連記事
- 作者:山田 祥寛
- 発売日: 2019/08/22
- メディア: 単行本