Skip to content

Commit 8e4f162

Browse files
committed
add pwacompat
1 parent 05a9e47 commit 8e4f162

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> React template for web app, powered by [Poi](https://poi.js.org/).
44
55
- [x] [prettier](https://github.com/prettier/prettier) + eslint
6-
- [x] PWA support (by [offline-plugin](https://github.com/NekR/offline-plugin))
6+
- [x] PWA support (by [offline-plugin](https://github.com/NekR/offline-plugin) & [pwacompat](https://github.com/GoogleChromeLabs/pwacompat))
77
- [x] [TailwindCSS](https://tailwindcss.com/) & SASS
88
- [x] Routing & code splitting (by [curi](https://github.com/pshrmn/curi))
99

template/index.ejs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99

1010
<% if (pwa) { %>
1111
<link rel="manifest" href="<%%= htmlWebpackPlugin.files.publicPath %%>manifest.json">
12-
<meta name="theme-color" content="#ffffff">
12+
<script
13+
async
14+
src="https://cdn.rawgit.com/GoogleChrome/pwacompat/v2.0.2/pwacompat.min.js"
15+
integrity="sha384-Hed93irwedHCADsxBJAVmlSMiqpE9BIQPp1XK7tqJh5olTEJTCJnlE7wRU3IDOz9"
16+
crossorigin="anonymous"></script>
1317
<% } %>
1418

1519
<%% if (htmlWebpackPlugin.options.description) { %%>

template/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"dev": "poi",
66
"build": "poi build",
7+
"serve": "serve dist -l 8000",
78
"lint": "eslint --ext .js,.jsx --ignore-path .gitignore .",
89
"lint:fix": "eslint --fix --ext .js,.jsx --ignore-path .gitignore ."
910
},
@@ -37,7 +38,8 @@
3738
"purgecss-webpack-plugin": "^0.20.1",
3839
"purgecss-whitelister": "^1.1.3",
3940
"react-hot-loader": "^4.2.0",
40-
"sass-loader": "^6.0.7"<% if(tailwindcss) { %>,
41+
"sass-loader": "^6.0.7",
42+
"serve": "^7.2.0"<% if(tailwindcss) { %>,
4143
"tailwindcss": "^0.5.3"<% } %>
4244
},
4345
"resolutions": {

template/static/favicon.ico

12.8 KB
Binary file not shown.

template/static/logo-128.png

5.44 KB
Loading

template/static/manifest.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
{
22
"name": "<%= name %>",
33
"short_name": "<%= name %>",
4-
"icons": [{
5-
"src": "favicon.ico",
6-
"sizes": "64x64 32x32 24x24 16x16",
7-
"type": "image/x-icon"
8-
}],
9-
"start_url": "./",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64",
8+
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo-128.png",
12+
"sizes": "128x128"
13+
}
14+
],
15+
"start_url": "./?homescreen=true",
1016
"theme_color": "#ffffff",
1117
"background_color": "#ffffff",
1218
"orientation": "portrait",

0 commit comments

Comments
 (0)