sysgears / webpack-virtual-modules

Webpack Virtual Modules is a webpack plugin that lets you create, modify, and delete in-memory files in a way that webpack treats them as if they were physically presented in the file system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Plugin causes console noise when used alongside debug.js

AdrianBannister opened this issue · comments

  • I'd be willing to submit the fix

Describe the bug

When using the DEBUG environment variable to control what log messages we would like to see while using the debug package we are getting flooded by console.log messages from this plugin.

To Reproduce

Run a webpack build with this plugin loaded and set the DEBUG environment variable to anything. It will spit out tons of console.log messages.

Additional context

The offending code is here:

if (process.env.DEBUG)
// eslint-disable-next-line no-console
console.log(this._compiler.name, 'Write virtual module:', modulePath, contents);

Might I suggest to changing the environment variable being checked to something like WVM_DEBUG. I'd happily create a PR if you are okay with this.

@AdrianBannister Yep, such a PR sounds good

Closed with #108