diff --git a/packages/next-bundle-analyzer/index.d.ts b/packages/next-bundle-analyzer/index.d.ts index 46d7ca853d3ca..5a97ee9b5be4b 100644 --- a/packages/next-bundle-analyzer/index.d.ts +++ b/packages/next-bundle-analyzer/index.d.ts @@ -1,8 +1,8 @@ import type { NextConfig } from 'next' -type NextBundleAnalyzer = (options?: { - enabled?: boolean - openAnalyzer?: boolean -}) => (config?: NextConfig) => NextConfig +declare const NextBundleAnalyzer = + (options?: { enabled?: boolean; openAnalyzer?: boolean }) => + (config?: NextConfig) => + NextConfig export = NextBundleAnalyzer diff --git a/test/production/typescript-basic/app/server.ts b/test/production/typescript-basic/app/server.ts index 2e0ec7fd97fd9..37051eea302a1 100644 --- a/test/production/typescript-basic/app/server.ts +++ b/test/production/typescript-basic/app/server.ts @@ -1,4 +1,9 @@ import next from 'next' +import bundleAnalyzer from '@next/bundle-analyzer' + +// eslint-disable-next-line +const config = bundleAnalyzer({}) + const app = next({ dir: '.', dev: process.env.NODE_ENV !== 'production', diff --git a/test/production/typescript-basic/index.test.ts b/test/production/typescript-basic/index.test.ts index 4af5357f612c5..dd79355efbf3c 100644 --- a/test/production/typescript-basic/index.test.ts +++ b/test/production/typescript-basic/index.test.ts @@ -10,6 +10,7 @@ describe('TypeScript basic', () => { next = await createNext({ files: new FileRef(path.join(__dirname, 'app')), dependencies: { + '@next/bundle-analyzer': 'canary', typescript: 'latest', '@types/node': 'latest', '@types/react': 'latest',