belen-albeza / grunt-demo

Grunt example project
MIT License
2 stars 9 forks source link

Use load-grunt-tasks instead of declaring array of dependencies and loading tasks in a loop #1

Open pdehaan opened 10 years ago

pdehaan commented 10 years ago

Instead of this code in Gruntfile.js:

  [ // load plugins
    'grunt-contrib-jshint',
    'grunt-contrib-sass',
    'grunt-contrib-connect',
    'grunt-contrib-jasmine',
    'grunt-contrib-watch',
    'grunt-contrib-clean',
    'grunt-contrib-copy',
    'grunt-contrib-compress',
    'grunt-open'
  ].forEach(grunt.loadNpmTasks);

Maybe use something like load-grunt-tasks [1] which should reduce the code to this: require('load-grunt-tasks')(grunt);

[1] https://npmjs.org/package/load-grunt-tasks

belen-albeza commented 10 years ago

I'm not so sure, I would prefer people to learn the standard way and then maybe improving it further. What I can do is to put a comment indicating that there is such a plugin to make things easier. Does that sound good?