Skip to content

Commit

Permalink
Merge pull request #17 from fan9704/feature_firebase
Browse files Browse the repository at this point in the history
Fix Manifest Inject
  • Loading branch information
fan9704 authored Jul 18, 2023
2 parents ab1e1ce + d88ab03 commit 32fe404
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ jobs:
run: yarn install

- name: try to build the project
run: yarn build
run: yarn build:production


- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_dir: ./dist_netlify
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pet Monitoring System</title>
</head>
Expand Down
15 changes: 8 additions & 7 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="alternate icon" href="/favicon.ico" type="image/png" sizes="16x16">
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180">
<link rel="mask-icon" href="/favicon.svg" color="#FFFFFF">
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
<link rel="alternate icon" href="./favicon.ico" type="image/png" sizes="16x16">
<link rel="apple-touch-icon" href="./apple-touch-icon.png" sizes="180x180">
<link rel="mask-icon" href="./favicon.svg" color="#FFFFFF">
<meta name="theme-color" content="#ffffff">
<link rel="manifest" href="/manifest.json" />
<link rel="manifest" href="./manifest.json" />
<script>
// if ("serviceWorker" in navigator) {
// navigator.serviceWorker
Expand All @@ -20,7 +20,7 @@
// .catch(err => console.log("service worker not registered", err));
// }
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('firebase-messaging-sw.js')
navigator.serviceWorker.register('./firebase-messaging-sw.js')
.then(reg => {
console.log(`Service Worker Registration (Scope: ${reg.scope})`);
})
Expand All @@ -36,7 +36,8 @@
</head>

<body>

<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
4 changes: 2 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export default ({ mode }) => {
}),
VitePWA({
mode: "development",
base: "/",
// base: "/",
// srcDir: "src",
// filename: "sw.js",
includeAssets: ["/favicon.png"],
includeAssets: ["./favicon.png"],
// strategies: "injectManifest",
manifest: {
name: "Pet Monitoring",
Expand Down

0 comments on commit 32fe404

Please sign in to comment.