Skip to content

Commit

Permalink
Migrate to next.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Oct 29, 2024
1 parent 8b37635 commit 91d864d
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions next.config.mjs → next.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { withContentCollections } from '@content-collections/next';
import withBundleAnalyzer from '@next/bundle-analyzer';
import type { NextConfig } from 'next';
import { createSecureHeaders } from 'next-secure-headers';

/** @type {import('next').NextConfig} */
const nextConfig = {
let config: NextConfig = {
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
Expand All @@ -22,7 +22,8 @@ const nextConfig = {
],
},

headers() {
// biome-ignore lint/suspicious/useAwait: headers is async
async headers() {
return [
{
source: '/(.*)',
Expand All @@ -37,17 +38,17 @@ const nextConfig = {
];
},

// biome-ignore lint/suspicious/useAwait: redirects is async
async redirects() {
return [
{
source: '/video',
destination:
'https://www.youtube.com/playlist?list=PLw95VUVc_2gh5oGx-jj9PnatiMKtQBiV2',
destination: '/',
permanent: true,
},
{
source: '/work/:slug',
destination: 'https://www.linkedin.com/in/haydenbleasel/',
destination: '/work',
permanent: true,
},
{
Expand All @@ -57,12 +58,12 @@ const nextConfig = {
},
{
source: '/clients',
destination: '/',
destination: '/work',
permanent: true,
},
{
source: '/apps',
destination: '/',
destination: '/about',
permanent: true,
},
{
Expand Down Expand Up @@ -92,19 +93,8 @@ const nextConfig = {
},
];
},

// Silence, contentlayer
webpack: (config) => {
config.infrastructureLogging = {
level: 'error',
};

return config;
},
};

let config = nextConfig;

if (process.env.ANALYZE === 'true') {
config = withBundleAnalyzer()(config);
} else {
Expand Down

0 comments on commit 91d864d

Please sign in to comment.