Skip to content

Commit df00c61

Browse files
committed
docs(pwa): update default pwa.manifestOptions
1 parent fcc88e3 commit df00c61

File tree

2 files changed

+76
-14
lines changed

2 files changed

+76
-14
lines changed

docs/core-plugins/pwa.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ file, or the `"vue"` field in `package.json`.
1919
[`workbox-webpack-plugin`](https://developer.chrome.com/docs/workbox/modules/workbox-webpack-plugin/).
2020

2121
- `'GenerateSW'` (default), will lead to a new service worker file being created
22-
each time you rebuild your web app.
22+
each time you rebuild your web app.
2323

2424
- `'InjectManifest'` allows you to start with an existing service worker file,
25-
and creates a copy of that file with a "precache manifest" injected into it.
25+
and creates a copy of that file with a "precache manifest" injected into it.
2626

2727
The "[Which Plugin to Use?](https://developer.chrome.com/docs/workbox/modules/workbox-webpack-plugin/#which-plugin-to-use)"
2828
guide can help you choose between the two modes.
@@ -78,11 +78,42 @@ file, or the `"vue"` field in `package.json`.
7878
The object will be used to generate the `manifest.json`
7979

8080
If the following attributes are not defined in the object, the options of `pwa` or default options will be used instead.
81-
- name: `pwa.name`
82-
- short_name: `pwa.name`
83-
- start_url: `'.'`
84-
- display: `'standalone'`
85-
- theme_color: `pwa.themeColor`
81+
- name: `pwa.name`
82+
- short_name: `pwa.name`
83+
- start_url: `'.'`
84+
- display: `'standalone'`
85+
- theme_color: `pwa.themeColor`
86+
- background_color: `#000000`
87+
- icon:
88+
89+
- Defaults:
90+
91+
```js
92+
[
93+
{
94+
src: "./img/icons/android-chrome-192x192.png",
95+
sizes: "192x192",
96+
type: "image/png",
97+
},
98+
{
99+
src: "./img/icons/android-chrome-512x512.png",
100+
sizes: "512x512",
101+
type: "image/png",
102+
},
103+
{
104+
src: "./img/icons/android-chrome-maskable-192x192.png",
105+
sizes: "192x192",
106+
type: "image/png",
107+
purpose: "maskable",
108+
},
109+
{
110+
src: "./img/icons/android-chrome-maskable-512x512.png",
111+
sizes: "512x512",
112+
type: "image/png",
113+
purpose: "maskable",
114+
},
115+
];
116+
```
86117

87118
- **pwa.manifestCrossorigin**
88119

packages/@vue/cli-plugin-pwa/README.md

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ file, or the `"vue"` field in `package.json`.
1919
[`workbox-webpack-plugin`](https://developer.chrome.com/docs/workbox/modules/workbox-webpack-plugin/).
2020

2121
- `'GenerateSW'` (default), will lead to a new service worker file being created
22-
each time you rebuild your web app.
22+
each time you rebuild your web app.
2323

2424
- `'InjectManifest'` allows you to start with an existing service worker file,
25-
and creates a copy of that file with a "precache manifest" injected into it.
25+
and creates a copy of that file with a "precache manifest" injected into it.
2626

2727
The "[Which Plugin to Use?](https://developer.chrome.com/docs/workbox/modules/workbox-webpack-plugin/#which-plugin-to-use)"
2828
guide can help you choose between the two modes.
@@ -78,11 +78,42 @@ file, or the `"vue"` field in `package.json`.
7878
The object will be used to generate the `manifest.json`
7979

8080
If the following attributes are not defined in the object, the options of `pwa` or default options will be used instead.
81-
- name: `pwa.name`
82-
- short_name: `pwa.name`
83-
- start_url: `'.'`
84-
- display: `'standalone'`
85-
- theme_color: `pwa.themeColor`
81+
- name: `pwa.name`
82+
- short_name: `pwa.name`
83+
- start_url: `'.'`
84+
- display: `'standalone'`
85+
- theme_color: `pwa.themeColor`
86+
- background_color: `#000000`
87+
- icon:
88+
89+
- Defaults:
90+
91+
```js
92+
[
93+
{
94+
src: "./img/icons/android-chrome-192x192.png",
95+
sizes: "192x192",
96+
type: "image/png",
97+
},
98+
{
99+
src: "./img/icons/android-chrome-512x512.png",
100+
sizes: "512x512",
101+
type: "image/png",
102+
},
103+
{
104+
src: "./img/icons/android-chrome-maskable-192x192.png",
105+
sizes: "192x192",
106+
type: "image/png",
107+
purpose: "maskable",
108+
},
109+
{
110+
src: "./img/icons/android-chrome-maskable-512x512.png",
111+
sizes: "512x512",
112+
type: "image/png",
113+
purpose: "maskable",
114+
},
115+
];
116+
```
86117

87118
- **pwa.manifestCrossorigin**
88119

0 commit comments

Comments
 (0)