Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

IE11 ES6 shim? #120

Closed
jwmann opened this issue Jan 15, 2018 · 4 comments
Closed

IE11 ES6 shim? #120

jwmann opened this issue Jan 15, 2018 · 4 comments

Comments

@jwmann
Copy link

jwmann commented Jan 15, 2018

My Web Workers work beautifully on every browser except for IE10-11
It's getting upset that I'm using ES6.
I'm trying to include an ES6 shim in my web worker like so:

require('es6-shim');

onmessage = function( event ) {
  console.log( 'rowsWorker', 'Start', event.data );
  const { foo, bar } = event.data;
  postMessage( "Please IE." );
}

But it seems to be ignored or something because it doesn't work. I tried babel-polyfill as well but no dice. Am I missing something?

@alexander-akait
Copy link
Member

@jwmann worker have own context, you should require inside worker context - i.e. look https://github.com/webpack-contrib/worker-loader#config inside file.worker.js

@jwmann
Copy link
Author

jwmann commented Jan 15, 2018

@evilebottnawi That's exactly where this code is from. My worker.

@alexander-akait
Copy link
Member

@jwmann hm, should be work, can you create minimum reproducible test repo?

@jwmann
Copy link
Author

jwmann commented Jan 15, 2018

I managed to solve this in a different way.
I don't need the es6-shim at all if I pass it through babel-loader in my import

import rowsExportWorker from 'worker-loader?name=/dist/rows.export.worker.js&publicPath=/modules/custom/mt360/app!babel-loader!../workers/rows.export.worker';

Adding !babel-loader fixed it.

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

No branches or pull requests

2 participants