@jiangtj/hexo-workbox

1.0.0 • Public • Published

Hexo Workbox

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.

feature status
swDest relative to build directory
importScripts
offlineGoogleAnalytics
runtimeCaching
globDirectory
additionalManifestEntries
babelPresetEnvTargets
cacheId plan
cleanupOutdatedCaches
clientsClaim
directoryIndex
dontCacheBustURLsMatching
globFollow
globIgnores
globPatterns
globStrict
ignoreURLParametersMatching
inlineWorkboxRuntime
manifestTransforms
maximumFileSizeToCacheInBytes plan
mode
modifyURLPrefix
navigateFallback
navigateFallbackDenylist
navigateFallbackAllowlist
navigationPreload
skipWaiting plan
sourcemap
templatedURLs

Readme

Keywords

Package Sidebar

Install

npm i @jiangtj/hexo-workbox

Weekly Downloads

0

Version

1.0.0

License

LGPL-3.0

Unpacked Size

17.5 kB

Total Files

11

Last publish

Collaborators

  • jiangtj