IE 不支持 VueJS - Symfony 应用程序

IE not supporting VueJS - Symfony application

如何在 IE11 中运行 VueJS - Symfony 应用程序?

我正在使用 Babel Encore

已经检查了 Stack 中的可用答案,但对我不起作用。另外,尝试将 @babel/polyfill 直接导入到 JS 中,但它也不起作用。

这是我的应用程序的webpack.config.js配置

const {VueLoaderPlugin} = require('vue-loader');
let Encore = require('@symfony/webpack-encore');

Encore
    .setOutputPath('public/build/')
    .setPublicPath('/build')
    .cleanupOutputBeforeBuild()
    .enableSourceMaps(!Encore.isProduction())
    .addEntry('app', './assets/js/app.js')
    // .enableVueLoader()
    .addLoader({
        test: /\.vue$/,
        loader: 'vue-loader'
    })
    .enableBuildNotifications()
    // .configureBabel(() => {}, {
    //     useBuiltIns: 'entry',
    //     corejs: 3
    // })

    .addPlugin(new VueLoaderPlugin())
    .enableSassLoader()
    .enableVersioning(Encore.isProduction())
;


module.exports = Encore.getWebpackConfig();

注意:IE 浏览器现在在控制台中显示错误 SCRIPT1010: Expected identifier 并显示空白页面。

问题已通过更新配置解决

const {VueLoaderPlugin} = require('vue-loader');
let Encore = require('@symfony/webpack-encore');

Encore
  .setOutputPath('public/build/')
  .setPublicPath('/build')
  .cleanupOutputBeforeBuild()
  .enableSourceMaps(!Encore.isProduction())
  .addEntry('app', './assets/js/app.js')
  .addLoader({
      test: /\.vue$/,
      loader: 'vue-loader'
  })
  .enableBuildNotifications()

  .addPlugin(new VueLoaderPlugin())
  .enableSassLoader()
  .enableVersioning(Encore.isProduction())
 .configureBabel(function(babelConfig) {
    // add additional presets
    // babelConfig.presets.push('@babel/preset-flow');

    // no plugins are added by default, but you can add some
    // babelConfig.plugins.push('styled-jsx/babel');
  }, {
    // node_modules is not processed through Babel by default
    // but you can whitelist specific modules to process
    // includeNodeModules: ['foundation-sites'],

    // or completely control the exclude rule (note that you
    // can't use both "includeNodeModules" and "exclude" at
    // the same time)
    exclude: /loadash/
  });

module.exports = Encore.getWebpackConfig();