DBILITY

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