Skip to content
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts


sw.*
workbox-*
swe-worker-*
21 changes: 19 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withContentlayer } = require("next-contentlayer");

const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
reloadOnOnline: true,
swcMinify: true,
disable: process.env.NODE_ENV === "development",
workboxOptions: {
disableDevLogs: true,
},
// ... other options you like
});

/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
Expand All @@ -9,7 +22,11 @@ const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
swcMinify: false,
reactStrictMode: true,
swcMinify: true,
compiler: {
removeConsole: process.env.NODE_ENV !== "development", // Remove console.log in production
},
};

module.exports = withContentlayer(nextConfig);
module.exports = withContentlayer(withPWA(nextConfig));
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"db-generate": "prisma generate"
},
"dependencies": {
"@ducanh2912/next-pwa": "^10.2.4",
"@prisma/client": "^5.3.1",
"@reduxjs/toolkit": "^1.9.7",
"@tailwindcss/typography": "^0.5.10",
Expand All @@ -46,13 +47,15 @@
"next": "14.0.3",
"next-auth": "^4.24.5",
"next-contentlayer": "^0.3.4",
"next-pwa": "^5.6.0",
"pino": "^8.16.2",
"postcss": "8.4.30",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-redux": "^8.1.3",
"react-toastify": "^9.1.3",
"tailwindcss": "3.3.3"
"tailwindcss": "3.3.3",
"webpack-manifest-plugin": "^5.0.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^13.5.4",
Expand Down
Loading