File tree Expand file tree Collapse file tree 4 files changed +374
-2918
lines changed Expand file tree Collapse file tree 4 files changed +374
-2918
lines changed Original file line number Diff line number Diff line change 11import { PHASE_DEVELOPMENT_SERVER , PHASE_PRODUCTION_BUILD } from 'next/constants.js' ;
22import i18nConfig from './next-i18next.config.js' ;
3+ import withSerwistInit from '@serwist/next' ;
34
45/**
56 * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
@@ -31,18 +32,10 @@ const nextConfig = {
3132 } ,
3233} ;
3334
34- // @ts -expect-error We don't need to type this function
35- const nextConfigFunction = async ( phase ) => {
36- if ( phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_BUILD ) {
37- const withPWA = ( await import ( '@ducanh2912/next-pwa' ) ) . default ( {
38- dest : 'public' ,
39- disable : 'development' === process . env . NODE_ENV ,
40- // @ts -expect-error buildExcludes is supported at runtime even if missing in types
41- buildExcludes : [ / _ n e x t \/ d y n a m i c - c s s - m a n i f e s t \. j s o n $ / ] ,
42- } ) ;
43- return withPWA ( nextConfig ) ;
44- }
45- return nextConfig ;
46- } ;
35+ const withSerwist = withSerwistInit ( {
36+ swSrc : 'worker/index.ts' ,
37+ swDest : 'public/sw.js' ,
38+ disable : process . env . NODE_ENV === 'development' , // Incompatible with Turbopack https://github.com/serwist/serwist/issues/54
39+ } ) ;
4740
48- export default nextConfigFunction ;
41+ export default withSerwist ( nextConfig ) ;
Original file line number Diff line number Diff line change 2828 "dependencies" : {
2929 "@aws-sdk/client-s3" : " ^3.515.0" ,
3030 "@aws-sdk/s3-request-presigner" : " ^3.515.0" ,
31- "@ducanh2912/next-pwa" : " ^10.2.9" ,
3231 "@heroicons/react" : " ^2.1.1" ,
3332 "@hookform/resolvers" : " ^3.3.4" ,
3433 "@icons-pack/react-simple-icons" : " ^13.7.0" ,
3534 "@next-auth/prisma-adapter" : " ^1.0.7" ,
3635 "@prisma/client" : " ^6.8.2" ,
36+ "@serwist/next" : " ^9.2.1" ,
3737 "@t3-oss/env-nextjs" : " ^0.11.1" ,
3838 "@tanstack/react-query" : " ^5.79.2" ,
3939 "@trpc/client" : " ^11.2.0" ,
8787 "prettier" : " ^3.2.4" ,
8888 "prettier-plugin-tailwindcss" : " ^0.6.12" ,
8989 "prisma" : " ^6.8.2" ,
90+ "serwist" : " ^9.2.1" ,
9091 "tailwind-merge" : " ^2.2.0" ,
9192 "tailwindcss" : " ^4.1.10" ,
9293 "ts-node" : " ^10.9.2" ,
You can’t perform that action at this time.
0 commit comments