leemunroe / grunt-email-workflow

A Grunt workflow for designing and testing responsive HTML email templates with SCSS.
MIT License
3.05k stars 339 forks source link

Only run necessary tasks when in grunt serve #88

Closed andersan closed 7 years ago

andersan commented 7 years ago

Hello,

Is there any way to only run relevant tasks when new files are added and the local server is running? I would like to be able to change a css file without imagemin running again, for example. Or is it better to just remove files from the src folder so they no longer affect the process?

romanlelek commented 7 years ago

Hello,

I think that you can define, which of your tasks should run in grunt/watch.js by parameter tasks: preview_dist: { files: ['./dist/*'], tasks: [], options: { livereload: true } }, When empty - it runs grunt's 'default' task. But you can add you own sequence of tasks e.g. forexample without imagemin.

Best regards, Roman

taeo commented 7 years ago

Chris, @romanlelek is mostly correct.

You would have to edit /grunt/aliases.yml to add a custom series of tasks. You would also need to modify or copy/rename some of the /grunt/*js tasks to suit your needs.

Issue #57 is along these lines as a feature request.

andersan commented 7 years ago

Thanks for the responses! I edited aliases.yml and made a separate task for minimizing images, removing it from the default tasks.

// $ grunt
default:
  - 'clean'
  - 'sass:dist'
  - 'assemble'
  - 'juice'

// Compress images
// $ grunt min
min:
  - 'imagemin'
  - 'replace:src_images'