rollup-plugin-analyzer
rollup-plugin-analyzer copied to clipboard
error TS2307: Cannot find module 'rollup' or its corresponding type declarations.
I'm using this plugin and TS. This line is problematic: https://github.com/doesdev/rollup-plugin-analyzer/blob/0cbf5d0df632a7a15d0d47d2a935f7246c282a89/index.d.ts#L1
../node_modules/.pnpm/[email protected]/node_modules/rollup-plugin-analyzer/index.d.ts:1:24 - error TS2307: Cannot find module 'rollup' or its corresponding type declarations.
1 import { Plugin } from "rollup";
The problem might be invisible to devs since rollup is in dev deps. I think Rollup must be declared as optional peer. It is in accordance with how other plugins declare it: https://github.com/rollup/plugins/blob/5ec2abe0325ed6b23bca26a5455d2a3b137e9e29/packages/node-resolve/package.json#L55-L62