Gruntfile.js.save 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Gruntfile.js
  2. // our wrapper function (required by grunt and its plugins)
  3. // all configuration goes inside this function
  4. module.exports = function(grunt) {
  5. // ===========================================================================
  6. // CONFIGURE GRUNT ===========================================================
  7. // ===========================================================================
  8. grunt.initConfig({
  9. // get the configuration info from package.json ----------------------------
  10. // this way we can use things like name and version (pkg.name)
  11. pkg: grunt.file.readJSON('package.json'),
  12. // all of our configuration will go here
  13. });
  14. // ===========================================================================
  15. // LOAD GRUNT PLUGINS ========================================================
  16. // ===========================================================================
  17. // we can only load these if they are in our package.json
  18. // make sure you have run npm install so our app can find these
  19. grunt.loadNpmTasks('grunt-contrib-jshint');
  20. grunt.loadNpmTasks('grunt-contrib-uglify');
  21. grunt.loadNpmTasks('grunt-contrib-less');
  22. grunt.loadNpmTasks('grunt-contrib-cssmin');
  23. grunt.loadNpmTasks('grunt-contrib-watch');
  24. };
  25. We will use the module.exports (wrapper) function. This is the Node way of exposing our configuration to the rest of our application. We don't have to worry about this too much, but if you are interested, read this great article on the topic. Inside of our grunt.initConfig(), we ha