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

IE8 does not support indexOf method of Array, #1595

Closed
shelbeniskb opened this issue Nov 6, 2015 · 3 comments
Closed

IE8 does not support indexOf method of Array, #1595

shelbeniskb opened this issue Nov 6, 2015 · 3 comments

Comments

@shelbeniskb
Copy link

I meet the code in webpack

if(installedModules[request].parents.indexOf(moduleId) < 0)

but the IE8 seems not support indexOf, how can I make a workaround?

@noomorph
Copy link

noomorph commented Nov 6, 2015

@shelbeniskb, well, maybe you could include a polyfill beforehand into your source HTML file...

<!--[if lte IE 8]>
<script type="text/javascript" src="ie8-polyfill.js"></script>
<![endif]-->

And then in your entry file write something like that:

require('file?name=[name].[ext]!polyfills/ie8-polyfill');

Webpack will put it into your output folder, and IE8 will load the polyfill...

@shelbeniskb
Copy link
Author

@noomorph Thanks, it can solve the problem, but not very well.
there is also another similar solution:

entry: {
    main: [
      'es5-shim',
      './src/js/main.js'
    ]
  }

@noomorph
Copy link

noomorph commented Nov 6, 2015

@shelbeniskb , ohhh, I thought webpack's bootstrap section in entry file is incomptabile with IE8... Your suggested option is a bit safer and cleaner.

@sokra sokra closed this as completed Nov 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants