DBILITY

독거 가능성 100% 노후에 라면값이라도 하게 센스를 발휘합시다!😅
Please click on the ad so that I can pay for ramen in my old age!
点击一下广告,让老后吃个泡面钱吧!
老後にラーメン代だけでもするように広告を一回クリックしてください。

react intellij PWA project generation 본문

front-end & ui/react

react intellij PWA project generation

DBILITY 2021. 12. 14. 16:07
반응형

그냥 New Project에서create-react-app부분에 --template cra-template-pwa를 추가하고 생성하면 되더라.

npm build해보니 asset-manifest.json도 있다.

index.js안에 serviceWorkerRegistration.unregister();를 serviceWorkerRegistration.register();로 변경하고 build.

이제 react 초보 학습중이라 build후 배포하고 실행해 보진 못했다.

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://cra.link/PWA
serviceWorkerRegistration.unregister();

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

반응형
Comments