Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makeswift plugin into Next.js config #1652

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add Makeswift plugin into Next.js config
  • Loading branch information
CNanninga committed Nov 18, 2024
commit 7d6d76c1766a24e6d13129c4ae8187a5411678d0
5 changes: 5 additions & 0 deletions core/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import bundleAnalyzer from '@next/bundle-analyzer';
import type { NextConfig } from 'next';
import createWithMakeswift from '@makeswift/runtime/next/plugin';
import createNextIntlPlugin from 'next-intl/plugin';
import { optimize } from 'webpack';

@@ -8,6 +9,7 @@ import { client } from './client';
import { graphql } from './client/graphql';
import { cspHeader } from './lib/content-security-policy';

const withMakeswift = createWithMakeswift({ previewMode: false });
const withNextIntl = createNextIntlPlugin();

const LocaleQuery = graphql(`
@@ -79,6 +81,9 @@ export default async (): Promise<NextConfig> => {
// Apply withNextIntl to the config
nextConfig = withNextIntl(nextConfig);

// Apply withMakeswift to the config
nextConfig = withMakeswift(nextConfig);

if (process.env.ANALYZE === 'true') {
const withBundleAnalyzer = bundleAnalyzer();

Loading