UNPKG

@serwist/next

Version:

A module that integrates Serwist into your Next.js application.

17 lines (13 loc) 674 B
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from "next/constants.js"; import type { NextConfigComplete } from "next/dist/server/config-shared.js"; import nextConfig = require("next/dist/server/config.js"); export const loadNextConfig = (cwd: string, isDev: boolean): Promise<NextConfigComplete> => { const nextPhase = isDev ? PHASE_DEVELOPMENT_SERVER : PHASE_PRODUCTION_BUILD; return nextConfig.default(nextPhase, cwd, { silent: false, }); }; export const generateGlobPatterns = (distDir: string): string[] => [ `${distDir}static/**/*.{js,css,html,ico,apng,png,avif,jpg,jpeg,jfif,pjpeg,pjp,gif,svg,webp,json,webmanifest}`, "public/**/*", ];