Skip to content

Commit

Permalink
docs: cleaned up next-pwa/getting-started
Browse files Browse the repository at this point in the history
  • Loading branch information
DuCanhGH committed Jun 22, 2023
1 parent 54ac6f7 commit 8aa06e4
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions docs/content/next-pwa/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,10 @@ const nextConfig = {
reactStrictMode: true,
};

/**
* @type {(
* phase: string,
* { defaultConfig }: { defaultConfig: NextConfig },
* ) => NextConfig}
*/
module.exports = (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_BUILD) {
const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
});
return withPWA(nextConfig);
}
Expand All @@ -98,25 +90,17 @@ const nextConfig = {
reactStrictMode: true,
};

/**
* @type {(
* phase: string,
* { defaultConfig }: { defaultConfig: NextConfig },
* ) => NextConfig}
*/
const nextPluginsCompose = async (phase) => {
const nextConfigFunction = async (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_BUILD) {
const withPWA = (await import("@ducanh2912/next-pwa")).default({
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
});
return withPWA(nextConfig);
}
return nextConfig;
};

export default nextPluginsCompose;
export default nextConfigFunction;
```

<Callout>
Expand Down

0 comments on commit 8aa06e4

Please sign in to comment.