Skip to content
Open

PWA #92

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/favicons/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/favicons/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/favicons/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/favicons/apple-touch-icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/favicons/favicon.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions src/index.prod.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
<meta name="viewport" content="initial-scale=1.0, width=device-width">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; child-src 'self' blob: file://*; connect-src *; img-src *; script-src 'self' blob: file://*; style-src 'self' 'unsafe-inline'; worker-src 'self' blob: file://*;">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Sunce">
<title>Sunce Wallet</title>
<link href="./App/css/fonts.css" rel="stylesheet">
<link href="./App/css/base-styles.css" rel="stylesheet">
<link href="./SplashScreen/splash.css" rel="stylesheet">
<link rel="prefetch" href="./Workers/net-worker.ts" as="worker" />
<link rel="apple-touch-icon" sizes="180x180" href="./favicons/apple-touch-icon-180x180.png">
<link rel="apple-touch-icon" sizes="512x512" href="./favicons/apple-touch-icon-512x512.png">
<link rel="icon" href="./favicons/favicon.ico">
</head>
<body>
<div id="app"></div>
Expand Down
20 changes: 20 additions & 0 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Sunce Wallet",
"short_name": "Sunce",
"start_url": "/",
"display": "standalone",
"background_color": "#d7b047",
"theme_color": "#000000",
"icons": [
{
"src": "./favicons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "./favicons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
4 changes: 3 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
},
"scripts": {
"prebuild": "rm -rf dist/",
"build": "NODE_ENV=production ../node_modules/.bin/parcel build ../src/index.prod.njk --public-url=./ --detailed-report --no-source-maps",
"build:parcel": "NODE_ENV=production ../node_modules/.bin/parcel build ../src/index.prod.njk --public-url=./ --no-source-maps",
"build:add-manifest": "cp ../src/manifest.json dist/ && cp -r ../src/favicons dist/ && sed 's|</head>|<link rel=\"manifest\" href=\"manifest.json\"></head>|' dist/index.prod.html > dist/index.prod.tmp && mv dist/index.prod.tmp dist/index.prod.html",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, что parcel должен сам в билд включать и фавиконки и манифест, потому что в html они заявлены 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@troggy,
А он включал. И перегрёбывал манифест, будто это модуль в JS :-/

"build": "npm run build:parcel && npm run build:add-manifest",
"dev": "NODE_ENV=development ../node_modules/.bin/parcel serve ../src/index.dev.njk -p 3000"
},
"browser": {
Expand Down