Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
"url": "https://github.com/netlify/primitives/issues"
},
"author": "Netlify Inc.",
"devDependencies": {
"dependencies": {
"@netlify/cache": "1.10.0",
"@netlify/runtime-utils": "1.2.0",
"@netlify/runtime-utils": "1.2.0"
},
"devDependencies": {
"@types/node": "^22.14.1",
"tsup": "^8.0.0",
"vitest": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface NetlifyPluginOptions extends Features {
middleware?: boolean
}

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.

const plugin: vite.Plugin = {
name: 'vite-plugin-netlify',
async configureServer(viteDevServer) {
Expand Down
Loading