LoginSignup
0
0

More than 3 years have passed since last update.

【自分用】VueがIE11で動かなかった

Posted at

WebpackとBabelを通しているがIE11で何も表示されなくなった

SCRIPT1002: Syntax error

Eval関数のところでエラーが出ていたので、webpackに以下の設定を追加してみたが、直らなかった

webpack.config.js
module.exports = {
    //...
    devtool: 'none'
}

原因はvueの読み込みところだった

script.js
import Vue from 'vue/dist/vue.esm.browser.min.js'

以下に変更

script.js
import Vue from 'vue'

resolve.alias の設定がされていないので、追加

webpack.config.js
module.exports = {
    //...
    resolve: {
        alias: {
            'vue$': 'vue/dist/vue.esm.js',
        }
    }
}

resolve.alias の指定は以下の記事を参考にした
https://blog.websandbag.com/entry/2020/08/07/190655

他のPJでは動いていたので、根本的な原因は別のところにあると思うが、とりあえず解決したのでここまで

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