1.0.0 • Published 4 years ago

@jiangtj/hexo-workbox v1.0.0

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
4 years ago

Hexo Workbox

npm.io npm

Install

If you use next or cake theme, just install it.

yarn add @jiangtj/hexo-workbox

Others, you need to install hexo5.0 or the latest master branch

Configure

pwa:
  # Generate manifest.json
  manifest:
    path: /manifest.json
    # See https://developer.mozilla.org/zh-CN/docs/Web/Manifest
    body:
      # name: Blog
      # short_name: dnocm
      # lang: zh-CN
      # display: standalone
      # background_color: "#ecedee"
      # theme_color: "#414852"
      # icons:
      #   - src: /images/favicon-32.png
      #     sizes: 32x32
      #     type: image/png
      #   - src: /images/favicon-192.png
      #     sizes: 192x192
      #     type: image/png
      #   - src: /images/favicon-512.png
      #     sizes: 512x512
      #     type: image/png
  # Generate sw.js
  serviceWorker:
    cdn: https://cdn.jsdelivr.net/npm/workbox-sw@5/build/workbox-sw.min.js
    # See workbox-build's `generateSW()` API
    # Here are some default configuration, see `./default.yaml`
    options:
      swDest: /sw.js

serviceWorker.options refer to the workbox-build's generateSW() API. Some configurations are not supported for the time being. See the compatibility table below.

featurestatus
swDest✔ relative to build directory
importScripts
offlineGoogleAnalytics
runtimeCaching
globDirectory
additionalManifestEntries
babelPresetEnvTargets
cacheIdplan
cleanupOutdatedCaches
clientsClaim
directoryIndex
dontCacheBustURLsMatching
globFollow
globIgnores
globPatterns
globStrict
ignoreURLParametersMatching
inlineWorkboxRuntime
manifestTransforms
maximumFileSizeToCacheInBytesplan
mode
modifyURLPrefix
navigateFallback
navigateFallbackDenylist
navigateFallbackAllowlist
navigationPreload
skipWaitingplan
sourcemap
templatedURLs