Unverified Commit dc3bd761 authored by stefanprobst's avatar stefanprobst Committed by GitHub

fix: fix bundle-analyzer plugin types (#38255)

* chore: fix bundle-analyzer types

* Add test for bundle analyzer type

* fix lint
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 2d987598
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
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',
......
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment