I created a plugin that changes the vite config of the app that uses it. Everything works but the custom logger function - why?
Minimal example:
export default function plugin(opts: PluginOptions): Plugin {
const logger = createLogger('info', {
prefix: '',
});
return {
name: 'vite-plugin',
enforce: 'pre',
config: () => ({
server: {
host: 'localhost',
},
customLogger: {
...logger,
info: (msg: string, options?: LogOptions) => logger.info(msg.replace('A', 'B'), options),
},
}),
};
}
If I insert the customLogger directly into the config of the app it works fine.