Closed momsse closed 6 years ago
Are you sure you need that? All browsers supporting ServiceWorker also support async/await - save for some really (over a year) old versions of Chrome and Firefox
And otherwise you can just import them in your sw.js file.
Encountering same issue that this guy (https://stackoverflow.com/questions/33527653/babel-6-regeneratorruntime-is-not-defined) : regeneratorRuntime is not defined
.
And unfortunately importing babel-polyfill
on the same module don't fix the issue :/
Do you need a minimal reproduction case so you can look at it ? Or no plan to consider this issue ?
If you have a minimal repo I can take a look if we can classify this as a bug, a reasonable feature request, or something that you can fix with a few lines of code yourself.
Thinking about what I wrote myself before; maybe the real solution will be to be able to use a separate babel config for the ServiceWorker. After all, as it only works on modern browsers it won't need as much transpiling.
@woutervanvliet did the minimal repo here => momsse/serviceworker-webpack-plugin-issue-11 but cannot reproduce the issue. The problem is probably elsewhere.
Thanks again and sorry for making you waste time :/
@momsse No worries - thanks for closing the issue, and sorry for the delayed response
Thanks guys for all the work done !
To use ES6 features like
async/await
i have to importbabel-polyfill
before using my ES6 code.serviceWorker/index.js:
serviceWorker/worker.js:
Is there a way to provide
babel-polyfill
on theentry
options or something like that as we can do onwebpack
?