Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too soon, too late... #31

Open
marcolino opened this issue Jul 29, 2014 · 2 comments
Open

Too soon, too late... #31

marcolino opened this issue Jul 29, 2014 · 2 comments

Comments

@marcolino
Copy link

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'
  ]);
@kopijunkie
Copy link

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.

@AdamCaviness
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants