Gruntfile.js 2.5 KB
'use strict';

module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    less: {
      dist: {
        files: 
        [
          {
            expand: true,
            cwd: 'css',
            src: ['*.less'],
            dest: 'css',
            ext: '.css'
          }
        ]
      }
    },
    watch: {
      options: {
        nospawn: true
      },
      css: {
        files: [
          'css/*.less',
        ],
        tasks: ['less'],
        options: {
          livereload: true
        }
      }
    },

    concat: {
      dist: {
        src: ['css/**/*.css'],
        dest: 'css/build.dest.css'
      }
    },

    ui_docs: {
      mydocs: {
        title: 'css-docs', // documentation page title
        docsPath: 'docs/styleguide/', // path where you want to generate the styleguide
        docsAssetsPath: 'assets/', // relative to docsPath
        docsUIDocsAssetsPath: 'css/', // relative to docsAssetsPath

        rawAssetsDir: 'css/', // path to the assets you want to document

        // js: {
          // rawDir: 'js/', // relative to rawAssetsDir
          // validExtensions: ['.js', '.coffe'],
          // ignore: ['**/vendor/**', '**/vendor-setup/**']
        // },
        css: {
          rawDir: 'css/', // relative to rawAssetsDir
          validExtensions: ['css'],
            // ['.scss', '.css', '.sass', '.styl', '.less'],
          ignore: ['**/bourbon/**'],
          builtFilePaths: ['css/build.dest.css'], // path to the generated sass file(s)
          outputDir: './' // relative to rawAssetsDir
        }
      }
    },

/*     apidoc: { */
      // myapp: {
        // src: 'js/',
        // dest: 'docs/apiguide/',
        // options: {
          // debug: true,
          // includeFilters: [ ".*\\.js$" ],
          // excludeFilters: [ "node_modules/" ]
        // }
      // }
    /* } */

    jsdoc : {
      dist : {
        src: ['js/**/*.js', 'README.md'],
        options: {
          destination : 'docs/jsdoc',
          template : "node_modules/ink-docstrap/template",
          configure : "node_modules/ink-docstrap/template/jsdoc.conf.json"
        }
      }
    }
  });

  grunt.loadNpmTasks( "grunt-contrib-less" );
  grunt.loadNpmTasks( "grunt-contrib-watch" );
  grunt.loadNpmTasks( "grunt-contrib-concat" );
  grunt.loadNpmTasks( "grunt-ui-docs" );
  grunt.loadNpmTasks( "grunt-apidoc" );
  grunt.loadNpmTasks( "grunt-jsdoc" );
  // grunt.loadNpmTasks('grunt-spritesmith');

  grunt.registerTask('default', [
    'less', 'watch'
  ]);
};