Skip to content

Commit

Permalink
fix(next): adapt config to work with prod modules only
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed May 16, 2023
1 parent b0ad33d commit 3db0934
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
/* eslint-disable global-require */
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-var-requires */
const { withSentryConfig } = require('@sentry/nextjs');
const withPlugins = require('next-compose-plugins');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
const path = require('path');

const nextPlugins = [withBundleAnalyzer];
const nextPlugins =
process.env.NODE_ENV === 'development'
? [
require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
}),
]
: [];

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand Down

0 comments on commit 3db0934

Please sign in to comment.