webpack-contrib / webpack-hot-middleware

Webpack hot reloading you can attach to your own server
MIT License
2.34k stars 297 forks source link

Example for eventsource-polyfill / IE #53

Open leiming opened 8 years ago

leiming commented 8 years ago

Could you provide a complete example of working on IE?

I refer the https://github.com/glenjamin/webpack-hot-middleware/issues/13 but it's not work.

glenjamin commented 8 years ago

I don't have easy access to IE, so I won't be able to provide a full working example.

If you have any specific errors then feel free to post more detail

leiming commented 8 years ago

Thanks for replying.

The full code is https://github.com/leiming/pcgame-react-boilerplate/tree/fix-ie

Just use https://github.com/gaearon/react-transform-boilerplate

and install eventsource-polyfill

npm install eventsource-polyfill --save-dev

and add eventsource-polyfill.js to entries:

// webpack.config.dev.js
// ...
module.exports = {
  devtool: 'eval',
  entry: [
    'eventsource-polyfill',
    'webpack-hot-middleware/client',
    './src/index'
  ],
// ...

and the error as follow:

\ 日志: polyfill-eventsource added missing EventSource to window **

errpr

It is running in the virtual machine of Parallels that use IE 8 in windows 7.

glenjamin commented 8 years ago

If anyone is able to contribute an example including the polyfill for IE, please do.

cl1ck commented 8 years ago

Just tested in IE11. The modified webpack config provided by @leiming is working perfectly. * 日志: polyfill-eventsource added missing EventSource to window * is not an error, just an that the polyfill was added successfully.

@leiming: I suspect the errors lie somewhere else in your application.

leiming commented 8 years ago

@cl1ck , This code is work with IE 11, but IE 8 in Win7.

wuhw commented 7 years ago

@leiming I just add the 'event-source-polyfill' to the entry chunk and it works

wuhw commented 7 years ago

use the npm package named 'event-source-polyfill' and add this to entry chunk without any loader or plugin. module.exports = { devtool: 'eval', entry: [ 'event-source-polyfill', 'webpack-hot-middleware/client', './src/index' ] } then it works for me. and I check the eventsource-polyfill's source code and I find some error in it. It could'not exports any thing to the window so that you got the error above.

johnjjung commented 6 years ago

this is ready for review

glenjamin commented 6 years ago

What is?

johnjjung commented 6 years ago

Lol whoops sorry wrong Issue

mtiger95 commented 6 years ago

I used the 'babel-polyfill' plugin, it also can't work in IE11 , but when 'npm run build',open the local index files ,it works, How strange ?

SuLiang2016 commented 6 years ago

but fo me,it doesn't work; I use the 'event-source-polyfill' as the example , I don't know where is wrong?

florida0723 commented 6 years ago

fuck IE