yjl9903 / vite-plugin-cloudflare-functions

Make Cloudflare Pages Functions works with Vite friendly
https://vite-plugin-cloudflare-functions.pages.dev/
MIT License
50 stars 6 forks source link

Allow disable dts generation #691

Closed Tsuk1ko closed 2 months ago

Tsuk1ko commented 2 months ago

Clear and concise description of the problem

For some reason, I don't need the cloudflare.d.ts file and I hope to disable the output.

Suggested solution

I think if dts is explicitly specified as false in the configuration, the output can be disabled.

https://github.com/yjl9903/vite-plugin-cloudflare-functions/blob/6c74b11b086d5d4a2804daa6eba31830a56abc01/packages/vite-plugin-cloudflare-functions/src/vite/index.ts#L50-L52

Change to

if (typeof userConfig.dts !== 'boolean' && typeof userConfig.dts !== 'string') {
  userConfig.dts = true;
}

Additional context

No response

yjl9903 commented 2 months ago

Fixed in https://github.com/yjl9903/vite-plugin-cloudflare-functions/commit/9a65cb67aef7e18f5d890eb96c2b01073592d4a4