How to transpile dependencies with @vue/cli 4.3.1

Viewed 4945

I have an app that has to work in IE11

Some dependencies like lodash use fat arrows (=>) and i want to target them to transpile them in es5.

I consulted many other posts that address that problem but nothing seems to work in my case. My chunk-vendors.js file constantly has the same number of fat arrows

Here are my settings so far

babel.config.js

process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
module.exports = {
  presets: [
    [
        '@vue/cli-plugin-babel/preset',
        {
        "useBuiltIns": "entry"
        }
    ]
  ]
}

vue.config.js

module.exports = {
    filenameHashing: process.env.NODE_ENV !== 'production',
    productionSourceMap: false,
    transpileDependencies: ["lodash"]
}

package.json

...
},
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "ie 11"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version",
      "ie 11"
    ]
  }
...
1 Answers
Related