vbenjs / vite-plugin-html

A vite plugin for processing html. It is developed based on lodash template
MIT License
582 stars 93 forks source link

Consola wraps EVERY log #58

Open sheremet-va opened 2 years ago

sheremet-va commented 2 years ago

Right now after importing/requiring this package, every console.log is wrapped with unnecessary log type. You should consider using it only inside logs in plugin.

Снимок экрана 2022-03-31 в 11 29 00
smcenlly commented 1 year ago

This behavior broke our integration with vitest (see https://github.com/wallabyjs/public/issues/3140).

It seems very heavy-handed to wrap all console.* functions when this is only required for a single verbose log warning:

https://github.com/vbenjs/vite-plugin-html/blob/841d4ef04c3cf5ff0d4339350ae336aa83aa70ed/packages/core/src/htmlPlugin.ts#L267

I think the responsibility of configuring / wrapping console.* statements should be the application not a library component.

We've worked around this issue.

david-crespo commented 7 months ago

This is very annoying. It took me quite a while to figure out it was coming from this plugin.

image
zephraph commented 7 months ago

It looks like it's due to:

https://github.com/vbenjs/vite-plugin-html/blob/a21ec7f4971312cc75ef3d7113b6d86e93dbfeac/packages/core/src/index.ts#L7