
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@ngx-pwa/ngsw-schema
Advanced tools
JSON schema for Angular service worker configuration file (ngsw-config.json)
ngsw-config.json
)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.
@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:
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"
}
MIT
FAQs
JSON schema for Angular service worker configuration file (ngsw-config.json)
We found that @ngx-pwa/ngsw-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.