valeriansaliou / gulp-remove-logging

:shower: Removes console logging statements.
http://npmjs.com/package/gulp-remove-logging
MIT License
8 stars 2 forks source link

Is inline javascript supported by this package #5

Open danielleevandenbosch opened 3 years ago

danielleevandenbosch commented 3 years ago

Would it be possible to add to the package whether javascript outside of a js file is supported?

Like the javascript between 2 script tags?

valeriansaliou commented 3 years ago

Could you please explain? Not sure to understand.

jschuur commented 2 years ago

Came here looking for this too. I needed something to remove console.log statements from within script tags inside .html files, not .js files.

This doesn't seem to quite work and it ended out stripping out too much, It turned this:

      if(mraid.getState() === 'loading') {
        console.log('mraid.getState is loading, setting up ready event listener')

        mraid.addEventListener("ready", () => tryLaunching({ launchGame: true }));
      } else if (mraid.getState() === 'default') {
        console.log('mraid.getState is default, attempting to launch playable')

        tryLaunching({ launchGame: true });
      }

Into this and actually removed everything in the if/else blocks:

      if(mraid.getState() === 'loading') {
        0;
      } else if (mraid.getState() === 'default') {
        0;
      }

I also had to at least add replaceWith='0;' as an option, or it created problematic stuff like this:

      } else 

      startApp();
      launched = true;

...if you had a dangling else:

      } else 
        console.log('Skipping MRAID orientation properties before launch attempt');