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

Commit

Permalink
feat: pwa option (defaults to false)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Jun 9, 2019
1 parent 9b9295b commit 6a5c282
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
19 changes: 19 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,25 @@ Whether to extract summary from source markdowns.
Set the length of summary.


### pwa

- Type: `boolean`
- Default: `false`

Whether to enable PWA support. this option is powered by the [official
PWA plugin](https://v1.vuepress.vuejs.org/plugin/official/plugin-pwa.html).

if you enable this option, the default options of the internal PWA
plugin is as follows:

```js
{
serviceWorker: true,
updatePopup: true
}
```


## Front Matter

### tag/tags
Expand Down
16 changes: 11 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = (themeConfig, ctx) => {
themeConfig,
{
summary: true,
summaryLength: 200
summaryLength: 200,
pwa: false,
}
)

Expand Down Expand Up @@ -62,16 +63,21 @@ module.exports = (themeConfig, ctx) => {
['@vuepress/search', {
searchMaxSuggestions: 10
}],
['@vuepress/pwa', {
serviceWorker: true,
updatePopup: true
}],
[
'@vuepress/blog',
blogPluginOptions,
],
]

if (themeConfig.pwa) {
plugins.push(
['@vuepress/pwa', {
serviceWorker: true,
updatePopup: true
}],
)
}

const config = {
plugins,
}
Expand Down

0 comments on commit 6a5c282

Please sign in to comment.