Nat*_*May 4 service-worker angular
更新很顺利,但现在当我构建时,我收到以下错误.
错误:预计在/ Users/nathanielmay/Code/firebaseTest文件夹中找到ngsw-config.json配置文件.在angular.json配置文件中提供一个或禁用Service Worker.
我看着我angular.json,发现在这一行:
"ngswConfigPath": "/src/ngsw-config.json",
Run Code Online (Sandbox Code Playgroud)
不允许使用属性ngswConfigPath.
我找不到新的angular.json的api,但似乎我需要以不同的方式指定路径.
ng update @angular/pwa 也没用.
我该如何解决这个错误?
Nat*_*May 10
我不确定是怎么"ngswConfigPath": "/src/ngsw-config.json"添加的,但是我删除它并且它构建得很好.
我面临的下一个问题是在升级过程中ngsw-config.json已经移出了src项目根目录.我必须将我的更新复制到根目录中ngsw-config.json,以便服务工作者正确注册.
对于我的案例问题与/路径前面添加的符号相关联,因此"ngswConfigPath": "/src/ngsw-config.json"我没有使用"ngswConfigPath": "src/ngsw-config.json"并发布修复.
| 归档时间: |
|
| 查看次数: |
2751 次 |
| 最近记录: |