This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-5
lines changed
Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,25 @@ Whether to extract summary from source markdowns.
209209Set 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments