|
1 |
| -module.exports = function(grunt) { |
| 1 | +'use strict'; |
2 | 2 |
|
3 |
| - // Load all Grunt tasks. |
4 |
| - require('load-grunt-tasks')(grunt); |
| 3 | +module.exports = function (grunt) { |
5 | 4 |
|
6 |
| - // Grunt configuration. |
7 |
| - grunt.initConfig({ |
| 5 | + // Load all Grunt tasks. |
| 6 | + require('load-grunt-tasks')(grunt); |
8 | 7 |
|
9 |
| - pkg: grunt.file.readJSON('package.json'), |
| 8 | + // Grunt configuration. |
| 9 | + grunt.initConfig({ |
10 | 10 |
|
11 |
| - watch: { |
12 |
| - scripts: { |
13 |
| - files: [ |
14 |
| - 'Gruntfile.js', |
15 |
| - 'src/**/*.js', |
16 |
| - 'tests/specs/**/*.js', |
17 |
| - '!.grunt' |
18 |
| - ], |
19 |
| - tasks: ['jshint', 'jasmine'] |
20 |
| - } |
21 |
| - }, |
| 11 | + pkg: grunt.file.readJSON('package.json'), |
22 | 12 |
|
23 |
| - uglify: { |
24 |
| - all: { |
25 |
| - files: { |
26 |
| - 'dist/jquery.checkboxes-<%= pkg.version %>.min.js': ['src/jquery.checkboxes.js'] |
27 |
| - }, |
28 |
| - options: { |
29 |
| - banner: '/*! checkboxes.js v<%= pkg.version %> | ' + |
30 |
| - '(c) 2013, <%= grunt.template.today("yyyy") %> Rubens Mariuzzo | ' + |
31 |
| - 'http://github.com/rmariuzzo/checkboxes.js/LICENSE */', |
32 |
| - } |
33 |
| - } |
34 |
| - }, |
| 13 | + clean: ['dist'], |
| 14 | + |
| 15 | + watch: { |
| 16 | + scripts: { |
| 17 | + files: [ |
| 18 | + 'Gruntfile.js', |
| 19 | + 'src/**/*.js', |
| 20 | + 'tests/specs/**/*.js', |
| 21 | + '!.grunt' |
| 22 | + ], |
| 23 | + tasks: ['jshint', 'jasmine'] |
| 24 | + } |
| 25 | + }, |
35 | 26 |
|
36 |
| - jshint: { |
37 |
| - all: { |
38 |
| - src: [ |
39 |
| - 'Gruntfile.js', |
40 |
| - 'src/**/*.js', |
41 |
| - 'tests/spec/**/*.js' |
42 |
| - ], |
43 |
| - options: { |
44 |
| - jshintrc: true |
45 |
| - } |
46 |
| - } |
| 27 | + uglify: { |
| 28 | + all: { |
| 29 | + files: { |
| 30 | + 'dist/jquery.checkboxes-<%= pkg.version %>.min.js': ['src/jquery.checkboxes.js'] |
47 | 31 | },
|
| 32 | + options: { |
| 33 | + banner: '/*! checkboxes.js v<%= pkg.version %> | ' + |
| 34 | + '(c) 2013, <%= grunt.template.today("yyyy") %> Rubens Mariuzzo | ' + |
| 35 | + 'http://github.com/rmariuzzo/checkboxes.js/LICENSE */', |
| 36 | + } |
| 37 | + } |
| 38 | + }, |
| 39 | + |
| 40 | + jshint: { |
| 41 | + all: { |
| 42 | + src: [ |
| 43 | + 'Gruntfile.js', |
| 44 | + 'src/**/*.js', |
| 45 | + 'tests/spec/**/*.js' |
| 46 | + ], |
| 47 | + options: { |
| 48 | + jshintrc: true |
| 49 | + } |
| 50 | + } |
| 51 | + }, |
48 | 52 |
|
49 |
| - jasmine: { |
50 |
| - all: { |
51 |
| - src: 'src/**/*.js', |
52 |
| - options: { |
53 |
| - specs: 'tests/specs/*_spec.js', |
54 |
| - vendor: [ |
55 |
| - 'bower_components/jquery/dist/jquery.min.js', |
56 |
| - 'bower_components/jasmine-jquery/lib/jasmine-jquery.js' |
57 |
| - ] |
58 |
| - } |
59 |
| - } |
| 53 | + jasmine: { |
| 54 | + all: { |
| 55 | + src: 'src/**/*.js', |
| 56 | + options: { |
| 57 | + specs: 'tests/specs/*_spec.js', |
| 58 | + vendor: [ |
| 59 | + 'bower_components/jquery/dist/jquery.min.js', |
| 60 | + 'bower_components/jasmine-jquery/lib/jasmine-jquery.js' |
| 61 | + ] |
60 | 62 | }
|
| 63 | + } |
| 64 | + } |
61 | 65 |
|
62 |
| - }); |
| 66 | + }); |
63 | 67 |
|
64 |
| - grunt.registerTask('default', ['jshint', 'watch']); |
65 |
| - grunt.registerTask('build', ['jshint', 'jasmine', 'uglify']); |
66 |
| - grunt.registerTask('test', ['jasmine']); |
67 |
| - grunt.registerTask('travis', ['jshint', 'jasmine']); |
| 68 | + grunt.registerTask('default', ['jshint', 'watch']); |
| 69 | + grunt.registerTask('build', ['clean', 'jshint', 'jasmine', 'uglify']); |
| 70 | + grunt.registerTask('test', ['jasmine']); |
| 71 | + grunt.registerTask('travis', ['jshint', 'jasmine']); |
68 | 72 |
|
69 | 73 | };
|
0 commit comments