Skip to content

Commit

Permalink
[#19] PWA setting (#32)
Browse files Browse the repository at this point in the history
- lighthouse통과

Co-authored-by: cloud <[email protected]>
  • Loading branch information
sanghunlee-711 and cloud committed Oct 23, 2023
1 parent b222317 commit 4620141
Show file tree
Hide file tree
Showing 29 changed files with 2,124 additions and 30 deletions.
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
# testing
/coverage

# next.js > ec2 내 빌드 시 cpu딸림으로 인해 로컬 빌드 후 푸쉬하는 전략 선택
# next.js
/.next/
/out/



# production
/build

Expand All @@ -34,3 +36,17 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

# yarn
yarn-error.log

# pwa
**/public/precache.*.*.js
**/public/sw.js
**/public/workbox-*.js
**/public/worker-*.js
**/public/fallback-*.js
**/public/precache.*.*.js.map
**/public/sw.js.map
**/public/workbox-*.js.map
**/public/worker-*.js.map
**/public/fallback-*.js
10 changes: 8 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
// dev warning : https://github.com/GoogleChrome/workbox/issues/1790
const prod = process.env.NODE_ENV === 'production';

module.exports = nextConfig
const withPWA = require('next-pwa')({
disable: prod ? false : true,
dest: 'public',
});

module.exports = withPWA;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"eslint-config-next": "13.4.12",
"eslint-plugin-testing-library": "^6.0.2",
"next": "13.4.12",
"next-pwa": "^5.6.0",
"react": "18.2.0",
"react-day-picker": "^8.8.0",
"react-dom": "18.2.0",
Expand Down
Binary file added public/images/favicon-16x16.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 public/images/favicon-32x32.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 public/images/icon-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 public/images/icon-256x256.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 public/images/icon-384x384.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 public/images/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.
File renamed without changes
Binary file added public/images/splashscreens/ipad_splash.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 public/images/splashscreens/ipadpro1_splash.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 public/images/splashscreens/ipadpro2_splash.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 public/images/splashscreens/ipadpro3_splash.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 public/images/splashscreens/iphone5_splash.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 public/images/splashscreens/iphone6_splash.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 public/images/splashscreens/iphoneplus_splash.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 public/images/splashscreens/iphonex_splash.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 public/images/splashscreens/iphonexr_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
38 changes: 38 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"theme_color": "#fffff",
"background_color": "#fffff",
"display": "standalone",
"scope": "/",
"start_url": "/",
"name": "iron-mate",
"short_name": "iron-mate",
"description": "webapp for do ironing",
"icons": [
{
"src": "images/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "images/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "images/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "images/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "images/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
1 change: 0 additions & 1 deletion public/next.svg

This file was deleted.

1 change: 0 additions & 1 deletion public/vercel.svg

This file was deleted.

14 changes: 12 additions & 2 deletions src/app/components/Timer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ const Timer: React.FC<ITimerProps> = ({
role="button"
type="button"
>
<Image src="/stop-icon.svg" alt="stop" width={12} height={12} />
<Image
src="/images/stop-icon.svg"
alt="stop"
width={12}
height={12}
/>
</button>
) : (
<button
Expand All @@ -158,7 +163,12 @@ const Timer: React.FC<ITimerProps> = ({
role="button"
type="button"
>
<Image src="/start-icon.svg" alt="start" width={12} height={12} />
<Image
src="/images/start-icon.svg"
alt="start"
width={12}
height={12}
/>
</button>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/layout/BasicLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const BasicLayout: React.FC<PropsWithChildren<{}>> = ({ children }) => {
<BurgerButton isToggled={isToggle} handleToggle={handleToggle} />
<Image
className="icon"
src="/muscle-logo.svg"
src="/images/logo/muscle-logo.svg"
alt="logo"
width={42}
height={36}
Expand Down
66 changes: 66 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,72 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<link rel="manifest" href="/manifest.json" />
<link
href="images/favicon-16x16.png"
rel="icon"
type="image/png"
sizes="16x16"
/>
<link
href="images/favicon-32x32.png"
rel="icon"
type="image/png"
sizes="32x32"
/>
<link rel="apple-touch-icon" href="images/icon-192x192.png"></link>
<meta name="msapplication-TileColor" content="#fffff"></meta>
<link
href="images/splashscreens/iphone5_splash.png"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/iphone6_splash.png"
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/iphoneplus_splash.png"
media="(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/iphonex_splash.png"
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/iphonexr_splash.png"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/iphonexsmax_splash.png"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/ipad_splash.png"
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/ipadpro1_splash.png"
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/ipadpro3_splash.png"
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="images/splashscreens/ipadpro2_splash.png"
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<meta name="theme-color" content="#fffff" />
<body className={inter.className} suppressHydrationWarning={true}>
<BasicLayout>{children}</BasicLayout>
</body>
Expand Down
Loading

0 comments on commit 4620141

Please sign in to comment.