static-cms/packages/docs/next.config.js
2024-03-13 08:58:25 -04:00

40 lines
784 B
JavaScript

const withPWA = require('next-pwa')({
publicExcludes: ['!bulletins/**/*'],
dest: 'public',
});
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const redirects = [
{ source: '/docs', destination: '/docs/intro', permanent: true },
];
/** @type {import('next').NextConfig} */
let config = {
reactStrictMode: true,
swcMinify: true,
redirects: async () => {
return redirects;
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'img.shields.io',
port: '',
pathname: '/badge/**',
},
],
},
};
if (process.env.NODE_ENV === 'production') {
config = withPWA(config);
} else {
config = withBundleAnalyzer(config);
}
module.exports = config;