Vue-cli: Unknown option: .polyfills when trying to add polyfills

Created on 12 Nov 2018  路  1Comment  路  Source: vuejs/vue-cli

Version

3.1.1

Reproduction link

https://github.com/abreitenfeld/vue-polyfills

Node and OS info

Node v8.11.4
NPM v.5.6.0

Steps to reproduce

  1. Create a fresh Vue project via the CLI
  2. Extend the babel.config.js with the preset polyfills (according to the CLI documentation)
  3. Try to build the project

What is expected?

Build succeeds with the given polyfills

What is actually happening?

Build fails with the error Unknown option: .polyfills


I used the example from https://cli.vuejs.org/guide/browser-compatibility.html#polyfills

Most helpful comment

module.exports = {
  presets: [
-    '@vue/app', {
+    ['@vue/app', {
      polyfills: [
        'es6.promise',
        'es6.symbol'
      ]
-    }
+    }]
  ]
}

>All comments

module.exports = {
  presets: [
-    '@vue/app', {
+    ['@vue/app', {
      polyfills: [
        'es6.promise',
        'es6.symbol'
      ]
-    }
+    }]
  ]
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

OmgImAlexis picture OmgImAlexis  路  3Comments

sanderswang picture sanderswang  路  3Comments

brandon93s picture brandon93s  路  3Comments

Akryum picture Akryum  路  3Comments

Gonzalo2683 picture Gonzalo2683  路  3Comments