Gathering detailed insights and metrics for hexo-workbox-build
Gathering detailed insights and metrics for hexo-workbox-build
Gathering detailed insights and metrics for hexo-workbox-build
Gathering detailed insights and metrics for hexo-workbox-build
npm install hexo-workbox-build
Typescript
Module System
Node Version
NPM Version
42.7
Supply Chain
26.1
Quality
74.7
Maintenance
100
Vulnerability
77.6
License
hexo-workbox-build@3.0.1
Updated on Feb 18, 2025
hexo-symbols-count-time-2@3.0.1
Updated on Feb 18, 2025
@uiolee/hexo-htmlnano@1.0.1
Updated on Feb 18, 2025
hexo-esbuild@2.0.0
Updated on Feb 18, 2025
hexo-absolute@3.0.0
Updated on Feb 17, 2025
hexo-symbols-count-time-2@3.0.0
Updated on Oct 06, 2024
JavaScript (46.51%)
TypeScript (45.93%)
HTML (6.73%)
Nunjucks (0.83%)
Total Downloads
1,696
Last Day
1
Last Week
2
Last Month
24
Last Year
576
MPL-2.0 License
1 Stars
70 Commits
1 Watchers
5 Branches
1 Contributors
Updated on Apr 09, 2025
Latest Version
3.0.1
Package Id
hexo-workbox-build@3.0.1
Unpacked Size
42.78 kB
Size
11.53 kB
File Count
19
NPM Version
10.9.2
Node Version
22.13.1
Published on
Feb 18, 2025
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
100%
2
Compared to previous week
Last Month
380%
24
Compared to previous month
Last Year
-43.1%
576
Compared to previous year
2
2
A hexo plugin to run workbox-build and provide convenient features of PWA and service worker.
manifest.json
from custom path to public\
.manifest.json
via <link>
tag in html.This plugin doesn't provide PWA support ready out of the box.
You need to know how to use workbox-build, configurate workbox strategy and custom your manifest.json
.
1pnpm add hexo-workbox-build 2 3# npm i hexo-workbox-build
1hexo_workbox_build: 2 enable: false 3 4 WB_runWorkboxBuild: true 5 WB_swDest: "" 6 WB_generateSWOptionsPath: "" 7 WB_injectManifestOptionsPath: "" 8 9 REG_generateRegister: true 10 REG_registerScriptDest: "registerSW.js" 11 # REG_registerScriptNjkPath: "" # default to internal nunjucks template 12 13 REG_injector: true 14 REG_injectorNjkString: '<script defer src="{{ REG_registerScriptDest }}"></script>' 15 16 MF_copyManifestJsonSrc: "" 17 MF_copyManifestJsonDest: "" 18 19 MF_injector: false 20 MF_injectorNjkString: '<link rel="manifest" href="{{ MF_cpoyManifestJsonDest }}" />'
1hexo_workbox_build: 2 enable: true 3 4 WB_runWorkboxBuild: true 5 WB_swDest: "sw.js" 6 WB_generateSWOptionsPath: "workbox/genSWOption.js" 7 # WB_injectManifestOptionsPath: "workbox/injMfOption.js" 8 9 REG_generateRegister: true 10 # REG_registerScriptDest: 'registerSW.js' 11 # REG_registerScriptNjkPath: "" # default to internal nunjucks template 12 13 REG_injector: true 14 # REG_injectorNjkString: '<script defer src="{{ REG_registerScriptDest }}"></script>' 15 16 MF_copyManifestJsonSrc: "workbox/manifest.json" 17 MF_copyManifestJsonDest: "manifest.json" 18 19 MF_injector: false 20 # MF_injectorNjkString: '<link rel="manifest" href="{{ MF_cpoyManifestJsonDest }}" />'
option name | value type | default value | note |
---|---|---|---|
enbale | boolean | false | Control whether to enable hexo-workbox-build . |
option name | value type | default value | note |
---|---|---|---|
WB_runWorkboxBuild | boolean | true | Control whether to run worlbox-build . |
WB_swDest | string | "" | Specify the name and path of service-worker that worlbox-build generated. (relative to public dir). equal to the swDest option in worlbox-build . |
WB_generateSWOptionsPath | string | "" | Need WB_swDest setting.Specify the path of a js file. (relative to your hexo dir), which use default exports the arguments of generatesw-mode of worlbox-build . |
WB_injectManifestOptionsPath | string | "" | Need WB_swDest generatesw-mode setting.Specify the path of a js file. (relative to your hexo dir), which use default exports the arguments of injectmanifest-mode of worlbox-build |
Note:
injectmanifest-mode
depend on a builtsw.js
.It means you need to run
generatesw-mode
first inhexo-workbox-build
.
option name | value type | default value | note |
---|---|---|---|
REG_generateRegister | boolean | true | Control whether to generater a javascript, which is use to register service-worker . |
REG_registerScriptDest | string | registerSW.js | Need WB_swDest .Specify the path of the above javascript code generated. (relative to public dir) |
REG_registerScriptNjkPath | string | "" | path of a nunjucks template of the javascript. (relative to your hexo dir) Default template: ./assets/registerScript.njk |
option name | value type | default value | note |
---|---|---|---|
REG_injector | boolean | true | Control whether to Inject the above javascript code into html <script> . You can use REG_injectorNjkString to custom it. |
REG_injectorNjkString | string | <script defer src="{{ REG_registerScriptDest }}"></script> | Custom the <scripts> string. |
manifest.json
manifest.json
into public
If set both
MF_copyManifestJsonSrc
andMF_copyManifestJsonDest
,hexo-workbox-build
will copy yourmanifest.json
topublic
dir.
In fact, you can simply put your
manifest.json
insource/
dir without using this above feature.
option name | value type | default value | note |
---|---|---|---|
MF_copyManifestJsonSrc | string | "" | Specify the path of your manifest.json . (relative to your hexo dir) |
MF_copyManifestJsonDest | string | "" | Specify the destiny path of your manifest.json . (relative to public dir) |
<link>
ref to your manifest.json
some themes likes next have the same feature, you may not to use this if you enable this feature in themes.
option name | value type | default value | note |
---|---|---|---|
MF_injector | boolean | false | need MF_copyManifestJsonDest .control whether to Inject <link> tag into head of html.You can use MF_injectorNjkString option to custom it. |
MF_injectorNjkString | string | <link rel="manifest" href="{{ MF_cpoyManifestJsonDest }}" /> | custom the <link> string. |
No vulnerabilities found.