简体   繁体   中英

I get reactjs serviceWorker.js instead of registerServiceWorker.js

When I build with "create-react-app projectname" At the first time I had registerServiceWorker.js in src directory but suddenly when I build new project I get just serviceWorker.js

  1. Why suddenly I get serviceWorker.js file when I buile new project? ( Of course it works fine when I copy registerServiceWorker file. bt I just wonder )
  2. And How can I fix to get registerServiceWorker.js when I create new app?

    • I am using node(v8.12.0), yarn(1.10.1)

看起来随着 Create React App 2.0 的发布,他们用 serviceWorker.js 替换了 registerServiceWorker.js,现在带有 CRA 的 service workers 是可选的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM