Skip to content

Conversation

@eduardoboucas
Copy link
Member

  • a7a1e83: The @netlify/runtime module needs @netlify/cache and @netlify/runtime-utils as runtime dependencies, not just development
  • ef1a4dd: Exposing the plugin as a default export, which seems to be a more widely used convention

}

export function netlify(options: NetlifyPluginOptions = {}): any {
export default function netlify(options: NetlifyPluginOptions = {}): any {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for this any? 👁️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a weird one! Basically if I use the right type here it gives me an error on the consumer side because TypeScript finds two Vite instances: one from the plugin and one from the consumer site. This makes it throw an error. I'm sure there's a better way to handle it, but I'm going with this for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I ran into the same thing with the Remix/RR7 Vite plugins.

I haven't looked carefully at the implementation carefully yet, but shouldn't you be able to mark vite as a dev dep and only specify a peer dep range? In the Vite plugins I've worked on at least, I only needed types from vite, no runtime imports.

@eduardoboucas eduardoboucas merged commit 7ebbd3a into main May 6, 2025
22 checks passed
@token-generator-app token-generator-app bot mentioned this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants