본문 바로가기 메뉴 바로가기

Aairon 개발 블로그

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Aairon 개발 블로그

검색하기 폼
  • 분류 전체보기 (144)
    • Retrospect (6)
    • Web (13)
    • JavaScript (16)
    • Nextjs (17)
    • React (21)
    • HTML & CSS (6)
    • DevEnv (22)
    • Git (15)
    • Deploy (8)
    • Record (16)
    • CS (3)
  • 방명록

PWA (2)
next js에서 pwa 다운로드 버튼 생성하기

데스크탑에서 크롬이나 모바일 안드로이드 같은 경우 beforeinstallpropmt 이벤트를 사용해서 다운로드 버튼을 만들 수 있지만 ios는 작성일 기준까지도 불가능하다. 1. beforeinstallpropmt 이벤트 등록하기 import React, { useEffect, useRef } from "react"; ... let deferredPrompt = useRef(null); useEffect(() => { console.log("Listening for Install prompt"); window.addEventListener("beforeinstallprompt", (e) => { e.preventDefault(); deferredPrompt.current = e; }); //설치가 되어..

Nextjs 2020. 8. 7. 13:36
next js에 pwa 적용하기

next js에서 pwa를 적용하여 모바일에서 다운로드가 가능하게 만드는 튜토리얼 입니다 1. next js 설치 npx create-next-app next js를 설치한다 2. next-pwa 설치 npm install next-pwa next js 프로젝트 안에 next-pwa 패키지를 설치한다 3. next.config.js 파일을 생성한다 해당 파일 안에 아래와 같이 작성한다 const withPWA = require('next-pwa') module.exports = withPWA({ pwa: { dest: 'public' } }) 다른 웹팩에 관련된 패키지를 적용하려면 아래와 같이 한다. const withPlugins = require("next-compose-plugins"); const..

Nextjs 2020. 8. 7. 11:48
이전 1 다음
이전 다음
공지사항
  • 프론트엔드 개발자 장철희 입니다

Blog is powered by Tistory / Designed by Tistory

티스토리툴바