Skip to content

Commit e924c46

Browse files
committed
fix(config): conditionally apply next-pwa so Turbopack runs in dev\n\nAvoid adding a webpack config in development by only wrapping nextConfig with next-pwa in production.
1 parent ea93ec4 commit e924c46

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

next.config.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ const nextConfig: NextConfig = {
77
},
88
};
99

10-
export default withPWA({
10+
// Avoid wrapping with next-pwa in development so Turbopack stays enabled.
11+
const isDev = process.env.NODE_ENV === "development";
12+
13+
const pwaPlugin = withPWA({
1114
dest: "public",
12-
disable: process.env.NODE_ENV === "development",
13-
})(nextConfig);
15+
disable: isDev,
16+
});
17+
18+
const config = isDev ? nextConfig : pwaPlugin(nextConfig);
19+
20+
export default config;

0 commit comments

Comments
 (0)