~webapps/ubuntu-html5-theme/16.04

« back to all changes in this revision

Viewing changes to Gruntfile.js

  • Committer: Adnane Belmadiaf
  • Date: 2013-06-18 23:18:49 UTC
  • Revision ID: daker@ubuntu.com-20130618231849-9zypgpb542lchzyy
Added support for Grunt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*global module:false*/
 
2
 
 
3
module.exports = function(grunt) {
 
4
 
 
5
  grunt.initConfig({
 
6
    pkg: grunt.file.readJSON('package.json'),
 
7
    meta: {
 
8
      banner:
 
9
        '/*!\n' +
 
10
        ' * app.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
 
11
        ' * https://launchpad.net/ubuntu-html5-theme\n' +
 
12
        ' * GNU LGPL v3\n' +
 
13
        ' */'
 
14
    },
 
15
    jshint: {
 
16
      options: {
 
17
        curly: false,
 
18
        eqeqeq: true,
 
19
        immed: true,
 
20
        latedef: true,
 
21
        newcap: true,
 
22
        noarg: true,
 
23
        sub: true,
 
24
        undef: true,
 
25
        eqnull: true,
 
26
        browser: true,
 
27
        expr: true,
 
28
        globals: {
 
29
          head: false,
 
30
          module: false,
 
31
          console: false
 
32
        }
 
33
      },
 
34
      files: [ 'Gruntfile.js', 'js/app.js' ]
 
35
    },
 
36
    concat: {
 
37
      options:{
 
38
        separator: ';'
 
39
      },
 
40
      js: {
 
41
        src: ['ambiance/js/*.js'],
 
42
        dest: 'build/app.js'
 
43
      },
 
44
      css:{
 
45
        src: ['ambiance/css/*.css'],
 
46
        dest: 'build/app.css'
 
47
      }
 
48
    },
 
49
    uglify: {
 
50
      options: {
 
51
        banner: '<%= meta.banner %>\n'
 
52
      },
 
53
      build: {
 
54
        src: '<%= concat.js.dest %>',
 
55
        dest: 'build/app.min.js'
 
56
      }
 
57
    },
 
58
 
 
59
    cssmin: {
 
60
      options: {
 
61
            banner: '/*!\n' +
 
62
        ' * app.min.css <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
 
63
        ' * https://launchpad.net/ubuntu-html5-theme\n' +
 
64
        ' * GNU LGPL v3\n' +
 
65
        ' */'
 
66
      },
 
67
      compress: {
 
68
        files: {
 
69
          'build/app.min.css': [ '<%= concat.css.dest %>' ]
 
70
        }
 
71
      }
 
72
    }
 
73
  });
 
74
 
 
75
  grunt.loadNpmTasks( 'grunt-contrib-jshint' );
 
76
  grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
 
77
  grunt.loadNpmTasks( 'grunt-contrib-uglify' );
 
78
  grunt.loadNpmTasks( 'grunt-contrib-concat' );
 
79
 
 
80
  // Default task.
 
81
  grunt.registerTask( 'default', [ 'jshint', 'concat', 'cssmin', 'uglify' ] );
 
82
};
 
 
b'\\ No newline at end of file'