grunt-remove-logging icon indicating copy to clipboard operation
grunt-remove-logging copied to clipboard

Too soon, too late...

Open marcolino opened this issue 10 years ago • 2 comments

I use 'removelogging', with this setup in my Gruntfile.js:

removelogging: {
  dist: {
    src: '<%= yeoman.dist %>/scripts/{,*/}*.js',
    options: {
      replaceWith: '0;'
    }
  }
},

The problem is: if I put 'removelogging' too soon in my build task list, dist files are later overwritte, and consol log persist in dist: if I put it too late I get JavaScript syntax errors... Where is the right place, given this tasklist?

grunt.registerTask('build', [
    'auto_install',
    'clean:dist',
    'favicons',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

marcolino avatar Jul 29 '14 13:07 marcolino

would like to know what's the best practice/answer for this too if anyone cares to comment?

personally, have settled on putting the 'removelogging' task after 'concat' and updated our project's 'uglify' task to minify the removelogging-generated JS file (i chose not to overwrite any existing file, concatenated or otherwise) as i also have 'uglify' set up to generate a JS sourcemap.

kopijunkie avatar Mar 31 '15 12:03 kopijunkie

+1

AdamCaviness avatar Dec 21 '15 19:12 AdamCaviness