Service Worker Helpers
approach is used to manage multiple helper libraries, each of which is versioned
and published to
A service worker implementation of the behavior defined in a page's App Cache manifest.
npm install --save-dev sw-appcache-behavior
A service worker helper library to retry offline Google Analytics requests when a connection is available.
npm install --save-dev sw-offline-google-analytics
Existing Build Tasks
Tasks are run via
gulp, and assume that you have a
gulp binary (
npm install -g gulp) as well as
a locally installed set of
node_module dependencies (
npm install from within
the top-level directory).
When running a task, an optional
--project=project-name parameter can be used.
gulp build:watch --project=sw-appcache-behavior.
By default the task will be run against all projects.
New projects should be created as sub-directories of projects,
following the basic layout of the existing projects. It’s recommended that each
library adopts the
sw- prefix, for consistency.
Always include the following:
src/- raw source files, with JSDoc-formatted comments.
exporta function that performs all the steps needed to produce a ready-to-use library in local
test/*.js- One or more Mocha test suites.
npmmetadata for the library. Each library is versioned independently.
demo/ directory is optional but encouraged. The project’s
will be automatically generated based on a template using the metadata found in
Please read the guide to contributing prior to filing any pull requests.
Copyright 2016 Google, Inc.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.