Angular ngsw/state 虚拟目录下的 service worker 调试信息?
Angular service worker debugging information under ngsw/state virtual directory?
我参考了 angular service workers 和 debugging(参见以下 link:https://angular.io/guide/service-worker-devops#locating-and-analyzing-debugging-information)。
引用文档:
The Angular service worker exposes debugging information under the
ngsw/
virtual directory. Currently, the single exposed URL is
ngsw/state
.
我一直没能在https://angular.io/ progressive web app: I tried appending ngsw/state
as follows: https://angular.io/ngsw/state 上找到ngsw/state
调试信息,但无济于事。我在源 devtools 选项卡中都找不到 ngsw/state
参考。更重要的是:什么是 虚拟目录 在哪里可以找到它?
有人可以指点一下吗?
出于某种原因,服务人员似乎没有在 https://angular.io progressive web app although I might be wrong (see: https://github.com/angular/angular/blob/master/aio/.angular-cli.json#L25) 上激活。
然而,通过使用 angular CLI 生成服务工作者应用程序:
ng new mySwProject --service-worker
然后在 prod 模式下构建它:
cd mySwProject
ng build --prod
并使用 http-server:
提供服务
cd dist
http-server -p 8080
可以使用以下方式查看 service worker 信息url:
http://localhost:8080/ngsw/state
输出:
NGSW Debug Info:
Driver state: NORMAL ((nominal))
Latest manifest hash: e60b43d83d323671c26f71fba9da395abdb4c01b
Last update check: 14s821u
=== Version e60b43d83d323671c26f71fba9da395abdb4c01b ===
Clients:
=== Idle Task Queue ===
Last update tick: 14s616u
Last update run: never
Task queue:
Debug log:
仅供参考:ng serve
不适用于文档中所述的 service worker:
As ng serve does not work with service workers, you must use a real
HTTP server to test your project locally. It's a good idea to test on
a dedicated port.
我参考了 angular service workers 和 debugging(参见以下 link:https://angular.io/guide/service-worker-devops#locating-and-analyzing-debugging-information)。
引用文档:
The Angular service worker exposes debugging information under the
ngsw/
virtual directory. Currently, the single exposed URL isngsw/state
.
我一直没能在https://angular.io/ progressive web app: I tried appending ngsw/state
as follows: https://angular.io/ngsw/state 上找到ngsw/state
调试信息,但无济于事。我在源 devtools 选项卡中都找不到 ngsw/state
参考。更重要的是:什么是 虚拟目录 在哪里可以找到它?
有人可以指点一下吗?
出于某种原因,服务人员似乎没有在 https://angular.io progressive web app although I might be wrong (see: https://github.com/angular/angular/blob/master/aio/.angular-cli.json#L25) 上激活。
然而,通过使用 angular CLI 生成服务工作者应用程序:
ng new mySwProject --service-worker
然后在 prod 模式下构建它:
cd mySwProject
ng build --prod
并使用 http-server:
提供服务cd dist
http-server -p 8080
可以使用以下方式查看 service worker 信息url:
http://localhost:8080/ngsw/state
输出:
NGSW Debug Info:
Driver state: NORMAL ((nominal))
Latest manifest hash: e60b43d83d323671c26f71fba9da395abdb4c01b
Last update check: 14s821u
=== Version e60b43d83d323671c26f71fba9da395abdb4c01b ===
Clients:
=== Idle Task Queue ===
Last update tick: 14s616u
Last update run: never
Task queue:
Debug log:
仅供参考:ng serve
不适用于文档中所述的 service worker:
As ng serve does not work with service workers, you must use a real HTTP server to test your project locally. It's a good idea to test on a dedicated port.