最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ServiceWorker with ES6 module imports (Google Chrome) - Stack Overflow

programmeradmin4浏览0评论

Is it possible to use ES6 module imports in serviceworkers in latest Google Chrome?

I found this closed thread on w3c specs but it's not clear to me how to make it work on Google Chrome.

Tryied this but with no luck:

navigator.serviceWorker.register('/sw.mjs', {type:'module'})

Is it possible to use ES6 module imports in serviceworkers in latest Google Chrome?

I found this closed thread on w3c specs but it's not clear to me how to make it work on Google Chrome.

Tryied this but with no luck:

navigator.serviceWorker.register('/sw.mjs', {type:'module'})
Share Improve this question asked Nov 18, 2018 at 11:12 Fabiano TaioliFabiano Taioli 5,5502 gold badges40 silver badges54 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

According to this article "JS module support for shared workers and service workers is ing soon ..." https://developers.google./web/fundamentals/primers/modules

Also, its tracked in this issue: https://bugs.chromium/p/chromium/issues/detail?id=680046

发布评论

评论列表(0)

  1. 暂无评论