2021-08-20 00:31:18 +00:00
|
|
|
/// <reference path='./next-pwa.d.ts' />
|
|
|
|
import type { BlitzConfig } from "blitz";
|
|
|
|
import { sessionMiddleware, simpleRolesIsAuthorized } from "blitz";
|
|
|
|
// import withPWA from "next-pwa";
|
2021-07-31 14:33:18 +00:00
|
|
|
|
2021-08-20 00:31:18 +00:00
|
|
|
type Module = Omit<NodeModule, "exports"> & { exports: BlitzConfig };
|
2021-08-01 16:28:47 +00:00
|
|
|
|
2021-08-20 00:31:18 +00:00
|
|
|
(module as Module).exports = {
|
2021-08-25 08:52:24 +00:00
|
|
|
async header() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: "/fonts/*.woff2",
|
|
|
|
headers: [
|
|
|
|
{
|
|
|
|
key: "Cache-Control",
|
|
|
|
value: "public, max-age=31536000, immutable",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
2021-07-31 14:33:18 +00:00
|
|
|
middleware: [
|
|
|
|
sessionMiddleware({
|
2021-08-03 13:03:10 +00:00
|
|
|
cookiePrefix: "shellphone",
|
2021-07-31 14:33:18 +00:00
|
|
|
isAuthorized: simpleRolesIsAuthorized,
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
serverRuntimeConfig: {
|
|
|
|
paddle: {
|
|
|
|
apiKey: process.env.PADDLE_API_KEY,
|
|
|
|
publicKey: process.env.PADDLE_PUBLIC_KEY,
|
|
|
|
},
|
|
|
|
awsSes: {
|
|
|
|
awsRegion: process.env.AWS_SES_REGION,
|
|
|
|
accessKeyId: process.env.AWS_SES_ACCESS_KEY_ID,
|
|
|
|
secretAccessKey: process.env.AWS_SES_ACCESS_KEY_SECRET,
|
|
|
|
fromEmail: process.env.AWS_SES_FROM_EMAIL,
|
|
|
|
},
|
|
|
|
mailChimp: {
|
|
|
|
apiKey: process.env.MAILCHIMP_API_KEY,
|
|
|
|
audienceId: process.env.MAILCHIMP_AUDIENCE_ID,
|
|
|
|
},
|
|
|
|
masterEncryptionKey: process.env.MASTER_ENCRYPTION_KEY,
|
2021-08-01 10:54:51 +00:00
|
|
|
app: {
|
2021-08-01 16:28:47 +00:00
|
|
|
baseUrl: process.env.APP_BASE_URL,
|
|
|
|
},
|
|
|
|
webPush: {
|
|
|
|
privateKey: process.env.WEB_PUSH_VAPID_PRIVATE_KEY,
|
|
|
|
},
|
2021-08-03 21:04:17 +00:00
|
|
|
datoCms: {
|
|
|
|
apiToken: process.env.DATOCMS_API_TOKEN,
|
|
|
|
previewSecret: process.env.DATOCMS_PREVIEW_SECRET,
|
|
|
|
},
|
2021-08-01 16:28:47 +00:00
|
|
|
},
|
|
|
|
publicRuntimeConfig: {
|
|
|
|
webPush: {
|
|
|
|
publicKey: process.env.WEB_PUSH_VAPID_PUBLIC_KEY,
|
2021-08-01 10:54:51 +00:00
|
|
|
},
|
2021-07-31 14:33:18 +00:00
|
|
|
},
|
|
|
|
/* Uncomment this to customize the webpack config
|
|
|
|
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
|
|
|
|
// Note: we provide webpack above so you should not `require` it
|
|
|
|
// Perform customizations to webpack config
|
|
|
|
// Important: return the modified config
|
|
|
|
return config
|
|
|
|
},
|
|
|
|
*/
|
2021-08-20 00:31:18 +00:00
|
|
|
/*pwa: {
|
|
|
|
dest: "public",
|
|
|
|
disable: process.env.NODE_ENV !== "production",
|
|
|
|
},*/
|
2021-07-31 15:57:43 +00:00
|
|
|
};
|