Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE3] pwa setting #21

Merged
merged 1 commit into from
Aug 12, 2022
Merged

[FE3] pwa setting #21

merged 1 commit into from
Aug 12, 2022

Conversation

JaeMeDev
Copy link
Member

  • next-pwa를 통한 pwa 설정

@JaeMeDev JaeMeDev requested a review from saseungmin as a code owner August 10, 2022 09:45
@JaeMeDev JaeMeDev self-assigned this Aug 10, 2022
@JaeMeDev
Copy link
Member Author

  • 아이콘이 아직 없어서 임의의 아이콘으로 설정했습니다. (디자이너 요청 후에 변경하도록 하겠습니다.)

@codecov-commenter
Copy link

Codecov Report

Merging #21 (30d7e11) into main (811edf0) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines           63        63           
  Branches         3         3           
=========================================
  Hits            63        63           

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

next.config.js Outdated
Comment on lines 34 to 47
module.exports = isProd ? withPlugins(
[
[
withPWA,
{
pwa: {
dest: 'public',
runtimeCaching,
},
},
],
],
nextConfig,
) : nextConfig;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withPWA에 disable 옵션이 있어용
다음과 같이 적용하면 dev환경에서는 PWA가 적용되지 않아요

module.exports = withPlugins([
  [withPWA, {
    pwa: {
      dest: 'public',
      maximumFileSizeToCacheInBytes: 7000000,
      disable: process.env.NODE_ENV === 'development',
      runtimeCaching,
    },
  }],
], nextConfig);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다. 원래 disable 옵션 줘서 작업했는데 develop환경에서 pwa가 오작동 하는 것 같아 빼고 저렇게 작업했었습니다. (결국엔 전부 오작동 하고 있었지만...)

알아보니 next-pwa@5.5.5에서 pwa 옵션이 빠져서 오작동하는 문제였고 next-pwa@5.5.4로 버전 변경해서 문제해결했습니다.

shadowwalker/next-pwa#368
shadowwalker/next-pwa#372

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 맞아요 이 이슈 있었어요👍

package.json Outdated
@@ -93,6 +94,7 @@
"jest-environment-jsdom": "^28.1.1",
"jest-plugin-context": "^2.9.0",
"lint-staged": "^13.0.3",
"next-compose-plugins": "^2.2.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next-compose-plugins는 런타임에도 필요한 플러그인이기 때문에 devDependencies가 아니라 dependencies로 설치해야합니다. 대부분의 플러그인 사용은 런타임에 필요해용

cyrilwanner/next-compose-plugins#15

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다!

Head, Html, Main, NextScript,
} from 'next/document';

export default class MyDocument extends Document {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default는 이렇게 하는게 좋아보여요!

export default MyDocument;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정했습니다!

@JaeMeDev JaeMeDev force-pushed the feature/FE-3 branch 2 times, most recently from 42f8943 to f924561 Compare August 11, 2022 08:25
Copy link
Member

@saseungmin saseungmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니당~~

@JaeMeDev JaeMeDev force-pushed the feature/FE-3 branch 3 times, most recently from 1001103 to 178d88f Compare August 12, 2022 00:12
@JaeMeDev JaeMeDev merged commit 4881e41 into dnd-side-project:main Aug 12, 2022
@JaeMeDev JaeMeDev deleted the feature/FE-3 branch August 12, 2022 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants