[Vuejs]-How to define the right Preset When using Nuxt in order to run on IE

0👍

solved that as well by removing a library called vue2-hammer. Now I have one issue in Chrome and in IE: ‘regeneratorRuntime is not defined’. tried every solution in Google and no solution. Now my Nuxt.config.js looks like this:

const polyfill = require('@babel/polyfill');

module.exports = {
  entry: [polyfill],
build: {
    extractCSS: true,
    extend(config, ctx) {
      if (ctx.isDev && ctx.isClient) {
        config.module.rules.push(
          {
            enforce: 'pre',
            test: /\.(js|vue)$/,
            loader: 'eslint-loader',
            exclude: /(node_modules)/,
          },
          {
            test: /\.js$/,
            loader: 'babel-loader',
            options: {
              plugins: [
                [
                  '@babel/plugin-transform-runtime',
                  {
                    corejs: false,
                    helpers: true,
                    regenerator: true,
                    useESModules: false,
                  },
                ],
                [
                  '@babel/plugin-transform-regenerator',
                  {
                    asyncGenerators: false,
                    generators: false,
                    async: false,
                  },
                ],
                'babel-plugin-transform-es2015-shorthand-properties',
                '@babel/plugin-transform-exponentiation-operator',
                '@babel/plugin-syntax-dynamic-import',
                '@babel/plugin-transform-arrow-functions',
              ],
            },
          },
        );
      }
    },
  },
  babel: {
    presets: [
      [
        'es2015',
        'stage-0',
      ],
    ],
    exclude: ['transform-regenerator'],
  },

Ant idea what can cause this?

Leave a comment