I've developed a plugin that successfully modifies the Vite configuration of the app it is linked to. However, I'm facing an issue with the custom logger function. Why is this happening?
Here's a basic example:
export default function customizePluginSettings(opts: PluginOptions): Plugin {
const log = createLogger('info', {
prefix: '',
});
return {
name: 'vite-plugin',
enforce: 'pre',
config: () => ({
server: {
host: 'localhost',
},
customLogger: {
...log,
info: (message: string, options?: LogOptions) => log.info(message.replace('A', 'B'), options),
},
}),
};
}
Interestingly, when I directly include the customLogger in the app's configuration, it functions perfectly fine.