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

setting: pwa 환경 세팅 #10

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import withPWA from "next-pwa";
import withPWAInit from "@ducanh2912/next-pwa"

/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {}

export default withPWA({ ...nextConfig, dest: "public" });
const isProd = process.env.NODE_ENV === "production" // 운영환경에서만 pwa 적용
const config = isProd ? withPWAInit({ dest: "public" })(nextConfig) : nextConfig

export default config
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"prepare": "husky"
},
"dependencies": {
"@ducanh2912/next-pwa": "^10.2.7",
"@tanstack/react-query": "^5.40.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand All @@ -39,7 +40,6 @@
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"next-pwa": "^5.6.0",
"postcss": "^8",
"prettier": "^3.3.1",
"tailwindcss": "^3.4.1",
Expand Down
625 changes: 211 additions & 414 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

337 changes: 336 additions & 1 deletion public/sw.js

Large diffs are not rendered by default.

Loading