带有 ES6 模块导入的 ServiceWorker (Google Chrome)

ServiceWorker with ES6 module imports (Google Chrome)

在最新的 Google Chrome 中是否可以在 serviceworkers 中使用 ES6 模块导入?

我发现这个关闭了 thread w3c 规范,但我不清楚如何让它在 Google Chrome.

上工作

试过这个但没有成功:

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

根据这篇文章 "JS module support for shared workers and service workers is coming soon ..." https://developers.google.com/web/fundamentals/primers/modules

此外,它在这个问题中被跟踪: https://bugs.chromium.org/p/chromium/issues/detail?id=680046