Add pwa
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
module.exports = {
|
||||
reactStrictMode: true,
|
||||
}
|
||||
const withPWA = require("next-pwa");
|
||||
const runtimeCaching = require("next-pwa/cache");
|
||||
|
||||
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants");
|
||||
|
||||
module.exports = (phase, { defaultConfig }) => {
|
||||
if (phase === PHASE_DEVELOPMENT_SERVER) {
|
||||
return {
|
||||
reactStrictMode: true,
|
||||
};
|
||||
}
|
||||
|
||||
return withPWA({
|
||||
reactStrictMode: true,
|
||||
pwa: {
|
||||
dest: "public",
|
||||
runtimeCaching,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user