remove next-pwa for now
This commit is contained in:
parent
77a1471974
commit
c0370030ce
@ -1,8 +1,11 @@
|
|||||||
import { BlitzConfig, sessionMiddleware, simpleRolesIsAuthorized } from "blitz";
|
/// <reference path='./next-pwa.d.ts' />
|
||||||
|
import type { BlitzConfig } from "blitz";
|
||||||
|
import { sessionMiddleware, simpleRolesIsAuthorized } from "blitz";
|
||||||
|
// import withPWA from "next-pwa";
|
||||||
|
|
||||||
const withPWA = require("next-pwa");
|
type Module = Omit<NodeModule, "exports"> & { exports: BlitzConfig };
|
||||||
|
|
||||||
const config: BlitzConfig = {
|
(module as Module).exports = {
|
||||||
middleware: [
|
middleware: [
|
||||||
sessionMiddleware({
|
sessionMiddleware({
|
||||||
cookiePrefix: "shellphone",
|
cookiePrefix: "shellphone",
|
||||||
@ -49,15 +52,8 @@ const config: BlitzConfig = {
|
|||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
/*pwa: {
|
||||||
|
dest: "public",
|
||||||
|
disable: process.env.NODE_ENV !== "production",
|
||||||
|
},*/
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports =
|
|
||||||
process.env.NODE_ENV === "test"
|
|
||||||
? config
|
|
||||||
: withPWA({
|
|
||||||
...config,
|
|
||||||
pwa: {
|
|
||||||
dest: "public",
|
|
||||||
disable: process.env.NODE_ENV !== "production",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
7
next-pwa.d.ts
vendored
Normal file
7
next-pwa.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import type { BlitzConfig } from "blitz";
|
||||||
|
|
||||||
|
declare module "next-pwa" {
|
||||||
|
function withPWA(config: BlitzConfig): BlitzConfig;
|
||||||
|
|
||||||
|
export default withPWA;
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
jest.mock("next-pwa", () => ({ __esModule: true, default: jest.fn().mockImplementation((config) => config) }));
|
||||||
|
|
||||||
import { setConfig } from "blitz";
|
import { setConfig } from "blitz";
|
||||||
|
|
||||||
// see https://github.com/vercel/next.js/issues/4024
|
// see https://github.com/vercel/next.js/issues/4024
|
||||||
|
Loading…
Reference in New Issue
Block a user