Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor's code ES6 not work in IE11 #1089

Closed
v1ar31 opened this issue Nov 20, 2017 · 3 comments
Closed

Vendor's code ES6 not work in IE11 #1089

v1ar31 opened this issue Nov 20, 2017 · 3 comments
Labels

Comments

@v1ar31
Copy link

v1ar31 commented Nov 20, 2017

My app contains vuejs (work), vue-resourse (not work).
When I tried to use es6-promise-polyfill in code, then app.[hash].js polyfilled and worked in IE11, but vendors.[hash].js not work. Babel-polyfill is not work eather.

How can I fix with problem? How can I polyfill vendors.[hash].js?

@LinusBorg
Copy link
Contributor

LinusBorg commented Nov 20, 2017

  • What means "don't work"? What error?
  • How exactly did you try to use the polyfill?

You don't have to "polyfill vendors.[hash].js" - polyfills are applied globally.

Usually, you just have to add this at the very top of `main.js

import 'es6-promise/auto'

@chasegiunta
Copy link

@LinusBorg I know this is closed and old, but I've been searching this issue for a few days now trying to solve. Theoretically, every npm package pulled into our projects should be polyfilled? Continually getting syntax errors with IE11. The syntax error actually looks like it related to => syntax used in Vue's core code.

Added import 'es6-promise/auto as you suggested, but unfortunately didn't resolve the issue.

If it helps, my babelrc file looks like this:

{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
      }
    }],
    "stage-2"
  ],
  "plugins": ["transform-vue-jsx", "transform-runtime", "transform-es2015-arrow-functions"]
}

Anything else I could I attempt? Thanks for your time.

@chasegiunta
Copy link

So, apparently this is a somewhat popular issue with babel's relationship to npm packages:

babel/babel-loader#171

A good catch-all solution I found is https://github.com/sheerun/targets-webpack-plugin but it does add a significant amount of time (and probably size) to your final bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants