|
1 |
| -module.exports = function (grunt) { |
2 |
| - "use strict"; |
3 |
| - |
4 |
| - // load all grunt tasks |
5 |
| - require('load-grunt-tasks')(grunt); |
6 |
| - |
7 |
| - // Default task. |
8 |
| - grunt.registerTask('default', ['jshint', 'karma']); |
9 |
| - |
10 |
| - // uglify |
11 |
| - grunt.registerTask('minify', ['uglify']); |
12 |
| - |
13 |
| - //connect - local server |
14 |
| - grunt.registerTask('serve', ['connect']); |
15 |
| - |
16 |
| - var testConfig = function (configFile, customOptions) { |
17 |
| - var options = { |
18 |
| - configFile : configFile, |
19 |
| - keepalive : true |
20 |
| - }; |
21 |
| - var travisOptions = process.env.TRAVIS && { |
22 |
| - browsers : ['Firefox'], |
23 |
| - reporters : 'dots' |
24 |
| - }; |
25 |
| - return grunt.util._.extend(options, customOptions, travisOptions); |
26 |
| - }; |
27 |
| - |
28 |
| - // Project configuration. |
29 |
| - grunt.initConfig({ |
30 |
| - karma : { |
31 |
| - unit : { |
32 |
| - options : testConfig('test/test.conf.js') |
33 |
| - } |
34 |
| - }, |
35 |
| - jshint : { |
36 |
| - files : ['src/**/*.js', 'test/**/*.js', 'demo/**/*.js'], |
37 |
| - jshintrc : true |
38 |
| - }, |
39 |
| - uglify : { |
40 |
| - build : { |
41 |
| - src : ['src/**/*.js'], |
42 |
| - dest : 'calendar.min.js' |
43 |
| - } |
44 |
| - }, |
45 |
| - connect : { |
46 |
| - server : { |
47 |
| - options : { |
48 |
| - port : 8000, |
49 |
| - open : true, |
50 |
| - debug : true, |
51 |
| - keepalive : true, |
52 |
| - hostname : '*', |
53 |
| - base : ['demo', '.'] |
54 |
| - } |
55 |
| - } |
56 |
| - } |
57 |
| - }); |
58 |
| - |
59 |
| -}; |
| 1 | +module.exports = function (grunt) { |
| 2 | + "use strict"; |
| 3 | + |
| 4 | + // load all grunt tasks |
| 5 | + require('load-grunt-tasks')(grunt); |
| 6 | + |
| 7 | + // Default task. |
| 8 | + grunt.registerTask('default', ['jshint', 'jscs', 'karma']); |
| 9 | + |
| 10 | + // uglify |
| 11 | + grunt.registerTask('minify', ['uglify']); |
| 12 | + |
| 13 | + //connect - local server |
| 14 | + grunt.registerTask('serve', ['connect']); |
| 15 | + |
| 16 | + var testConfig = function (configFile, customOptions) { |
| 17 | + var options = { |
| 18 | + configFile : configFile, |
| 19 | + keepalive : true |
| 20 | + }; |
| 21 | + var travisOptions = process.env.TRAVIS && { |
| 22 | + browsers : ['Firefox'], |
| 23 | + reporters : 'dots' |
| 24 | + }; |
| 25 | + return grunt.util._.extend(options, customOptions, travisOptions); |
| 26 | + }; |
| 27 | + |
| 28 | + // Project configuration. |
| 29 | + grunt.initConfig({ |
| 30 | + karma : { |
| 31 | + unit : { |
| 32 | + options : testConfig('test/test.conf.js') |
| 33 | + } |
| 34 | + }, |
| 35 | + jshint : { |
| 36 | + files : ['src/**/*.js'], |
| 37 | + options : { |
| 38 | + curly : true, |
| 39 | + devel : true, |
| 40 | + eqeqeq : true, |
| 41 | + forin : true, |
| 42 | + funcscope : true, |
| 43 | + latedef : "nofunc", |
| 44 | + laxbreak : true, |
| 45 | + loopfunc : true, |
| 46 | + maxdepth : 3, |
| 47 | + noarg : true, |
| 48 | + nonbsp : true, |
| 49 | + nonew : true, |
| 50 | + notypeof : true, |
| 51 | + shadow : false, |
| 52 | + browser : true, |
| 53 | + undef : true, |
| 54 | + unused : "vars", |
| 55 | + predef : [], |
| 56 | + globals : { |
| 57 | + moment : true, |
| 58 | + angular : true, |
| 59 | + $ : true, |
| 60 | + jasmine : true |
| 61 | + } |
| 62 | + } |
| 63 | + }, |
| 64 | + jscs : { |
| 65 | + all : [ |
| 66 | + ['src/**/*.js'] |
| 67 | + ], |
| 68 | + options : { |
| 69 | + config : '.jscsrc' |
| 70 | + } |
| 71 | + }, |
| 72 | + uglify : { |
| 73 | + build : { |
| 74 | + src : ['src/**/*.js'], |
| 75 | + dest : 'calendar.min.js' |
| 76 | + } |
| 77 | + }, |
| 78 | + connect : { |
| 79 | + server : { |
| 80 | + options : { |
| 81 | + port : 8000, |
| 82 | + open : true, |
| 83 | + debug : true, |
| 84 | + keepalive : true, |
| 85 | + hostname : '*', |
| 86 | + base : ['demo', '.'] |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + }); |
| 91 | +}; |
0 commit comments