Skip to content

options not work, neither targets ie11 in babel.config.js  #925

Open
@scil

Description

@scil

Webpack Version:
"webpack": "^5.65.0",

Babel Core Version:
"@babel/core": "^7.16.7",

Babel Loader Version:
"babel-loader": "^8.2.3",

Please tell us about your environment:
Windows 10

Current behavior:
not support ie 11, arrow function not converted.

babel config file

const presets = [
  [
    "@babel/preset-env",
    {
        debug: true,
        // "exclude": ["@babel/plugin-transform-regenerator"],
      targets: "ie 11",
      //     {
      //   // edge: "79",
      //   // chrome: "67",
      //   ie: "11",
      // },
      //useBuiltIns: "usage",
      useBuiltIns: "entry",
      corejs: "3.6.4",
    },
  ],
];

module.exports = { 
    presets,
    minified: isProduction,
    sourceMaps: isProduction? false: "inline",
    plugins:[ ],
};

Expected/desired behavior:

support ie 11, convert arrow function like this

export function getObjectDiff(obj1, obj2) {
    const diff = Object.keys(obj1).reduce((result, key) => {
        if (!obj2.hasOwnProperty(key)) {
            result.push(key);
        } else if (_.isEqual(obj1[key], obj2[key])) {
            const resultKeyIndex = result.indexOf(key);
            result.splice(resultKeyIndex, 1);
        }
        return result;
    }, Object.keys(obj2));

    return diff;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions