You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One can easily change the vite config of an app by loading a plugin that uses the config hook. However, this does not work for the customLogger property for some reason.
Run the app and observe no changes to the log output. Modify customLogger directly (commented out) and it works.
import{createLogger,defineConfig,LogOptions}from'vite';constlogger=createLogger();constcustomLogger={
...logger,info: (msg: string,options?: LogOptions)=>logger.info('Hi! I was inserted.\n'+msg,options),};constcustomServer={port: 666,};exportdefaultdefineConfig({plugins: [(()=>({name: 'logger-changer',config: ()=>({server: customServer,// <-- works
customLogger,// <-- doesn't work}),}))(),],});/* this works for some reasonexport default defineConfig({ server: customServer, // <-- works customLogger, // <-- works }});*/
The text was updated successfully, but these errors were encountered:
Describe the bug
One can easily change the vite config of an app by loading a plugin that uses the config hook. However, this does not work for the
customLogger
property for some reason.Reproduction
https://stackblitz.com/edit/vitejs-vite-gechfp?file=vite.config.ts&view=editor
Steps to reproduce
Run the app and observe no changes to the log output. Modify
customLogger
directly (commented out) and it works.The text was updated successfully, but these errors were encountered: