Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 6a5c282

Browse files
committed
feat: pwa option (defaults to false)
1 parent 9b9295b commit 6a5c282

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

docs/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,25 @@ Whether to extract summary from source markdowns.
209209
Set the length of summary.
210210

211211

212+
### pwa
213+
214+
- Type: `boolean`
215+
- Default: `false`
216+
217+
Whether to enable PWA support. this option is powered by the [official
218+
PWA plugin](https://v1.vuepress.vuejs.org/plugin/official/plugin-pwa.html).
219+
220+
if you enable this option, the default options of the internal PWA
221+
plugin is as follows:
222+
223+
```js
224+
{
225+
serviceWorker: true,
226+
updatePopup: true
227+
}
228+
```
229+
230+
212231
## Front Matter
213232

214233
### tag/tags

index.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ module.exports = (themeConfig, ctx) => {
66
themeConfig,
77
{
88
summary: true,
9-
summaryLength: 200
9+
summaryLength: 200,
10+
pwa: false,
1011
}
1112
)
1213

@@ -62,16 +63,21 @@ module.exports = (themeConfig, ctx) => {
6263
['@vuepress/search', {
6364
searchMaxSuggestions: 10
6465
}],
65-
['@vuepress/pwa', {
66-
serviceWorker: true,
67-
updatePopup: true
68-
}],
6966
[
7067
'@vuepress/blog',
7168
blogPluginOptions,
7269
],
7370
]
7471

72+
if (themeConfig.pwa) {
73+
plugins.push(
74+
['@vuepress/pwa', {
75+
serviceWorker: true,
76+
updatePopup: true
77+
}],
78+
)
79+
}
80+
7581
const config = {
7682
plugins,
7783
}

0 commit comments

Comments
 (0)