diff --git a/next.config.js b/next.config.js index cf4798ae71f37..cd0b54769add6 100644 --- a/next.config.js +++ b/next.config.js @@ -1,18 +1,16 @@ const createMDX = require('@next/mdx'); const remarkPrism = require('remark-prism'); -const isProd = process.env.NODE_ENV === 'production'; +const isProd = process.env.NODE_ENV === 'production' && !process.env.IS_PREVIEW; /** @type {import('next').NextConfig} */ const nextConfig = { - async headers() { - return [ - { - source: '/_next/static/([^/]+/pages|chunks|runtime|css|fonts|media)/(.+)', - headers: [{key: 'Access-Control-Allow-Origin', value: '*'}], - }, - ]; - }, + headers: [ + { + source: '/_next/static/([^/]+/pages|chunks|runtime|css|fonts|media)/(.+)', + headers: [{key: 'Access-Control-Allow-Origin', value: '*'}], + }, + ], publicRuntimeConfig: { assetPrefix: isProd ? 'https://docs.sentry.io' : undefined, },