Socket
Socket
Sign inDemoInstall

@ngx-pwa/ngsw-schema

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ngx-pwa/ngsw-schema

JSON schema for Angular service worker configuration file (ngsw-config.json)


Version published
Weekly downloads
25
decreased by-35.9%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

JSON schema for Angular service worker configuration file (ngsw-config.json)

Angular 8 update

My PR in Angular repo has been accepted and merged, so this feature is now directly available in Angular >= 8.0.0-beta.7. This lib is only useful in Angular 6 or 7.

By the same author

Why this lib?

@angular/service-worker is a very powerful tool to build Progressive Web Apps. The default service worker configuration file (ngsw-config.json) generated by the Angular CLI (either via ng add @angular/pwa or ng g service-worker) already takes care of saving permanently the static files of your application (index.html, JavaScript files...).

But you can go a lot further by adding dataGroups to save temporarily dynamic data (for example, your API calls, including images), which would be too big for localStorage or too difficult via indexedDB.

The official documentation explains it all, but as the ngsw-config.json file doesn't have a JSON schema, you don't get any assistance, and worse, mistakes are not always catched by the building system, so you could end up with errors in your production build.

So this lib is just the missing JSON schema for ngsw-config.json for productivity:

  • assistance,
  • no more errors!

Getting started

Install the lib (as a dev dependency):

npm install @ngx-pwa/ngsw-schema -D

Now you just have to add it to your ngsw-config.json file (of course, adapt the path to your case):

{
  "$schema": "../node_modules/@ngx-pwa/ngsw-schema/schema.json"
}

Changelog

Changelog available here.

License

MIT

Keywords

FAQs

Last updated on 06 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc