Closed matteocontrini closed 1 year ago
Hi, you're right. All the options should be optional. I'll fix it, thanks.
Done. Fixed with 7ab556bc686c06634c2d1e97f3c2bd2e479cf37f!
Thanks for the quick feedback!
I think there's the same problem in ViteManifest
too though.
in the json too?
What do you mean? I mean that the configuration is assumed to be always present here too, in the ViteManifest
class:
Ohh it’s true. I’ll fix it too
Hi, I've noticed that when using the development server unless you put some configuration in
appsettings.json
an exception is thrown:This is because the dev middleware expects the options object to always be non-null:
https://github.com/Eptagone/Vite.AspNetCore/blob/e1445995e0f427037775f693ced09b03cda8c3f8/src/Vite.AspNetCore/Services/ViteDevMiddleware.cs#L49-L53
However the readme says that:
So I guess the aim was to have some defaults that don't require adding configuration manually.
A workaround is to add empty configuration objects in
appsettings.json
, like:Which isn't really ideal.
I would suggest to either make configuration "optional" (with defaults) or to make it clearer in the docs that you always need to add some settings.
Thanks!