was.js – Diff between revs 21 and 24
?pathlinks?
Rev 21 | Rev 24 | |||
---|---|---|---|---|
1 | /*global module:false*/ |
1 | /*global module:false*/ |
|
2 | module.exports = function(grunt) { |
2 | module.exports = function(grunt) { |
|
3 | |
3 | |
|
4 | // Project configuration. |
4 | // Project configuration. |
|
5 | grunt.initConfig({ |
5 | grunt.initConfig({ |
|
6 | // Metadata. |
6 | // Metadata. |
|
7 | pkg: grunt.file.readJSON('package.json'), |
7 | pkg: grunt.file.readJSON('package.json'), |
|
8 | banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + |
8 | banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + |
|
9 | '<%= grunt.template.today("yyyy-mm-dd") %> \n' + |
9 | '<%= grunt.template.today("yyyy-mm-dd") %> \n' + |
|
10 | '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + |
10 | '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + |
|
11 | '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + |
11 | '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + |
|
12 | ' Licensed <%= pkg.license %> */\n', |
12 | ' Licensed <%= pkg.license %> */\n', |
|
13 | // Task configuration. |
13 | // Task configuration. |
|
14 | concat: { |
14 | concat: { |
|
15 | options: { |
15 | options: { |
|
16 | banner: '<%= banner %>', |
16 | banner: '<%= banner %>', |
|
17 | stripBanners: true |
17 | stripBanners: true |
|
18 | }, |
18 | }, |
|
19 | dist: { |
19 | dist: { |
|
20 | src: ['lib/**/*.js'], |
20 | src: ['lib/**/*.js'], |
|
21 | dest: 'dist/<%= pkg.name %>.js' |
21 | dest: 'dist/<%= pkg.name %>' // <%= pkg.name %>.js -> was.js |
|
22 | } |
22 | } |
|
23 | }, |
23 | }, |
|
24 | uglify: { |
24 | uglify: { |
|
25 | options: { |
25 | options: { |
|
26 | banner: '<%= banner %>' |
26 | banner: '<%= banner %>' |
|
27 | }, |
27 | }, |
|
28 | dist: { |
28 | dist: { |
|
29 | src: '<%= concat.dist.dest %>', |
29 | src: '<%= concat.dist.dest %>', |
|
30 | dest: 'dist/<%= pkg.name %>.min.js' |
30 | dest: 'dist/was.min.js' // <%= pkg.name %>.min.js -> was.min.js |
|
31 | } |
31 | } |
|
32 | }, |
32 | }, |
|
33 | jshint: { |
33 | jshint: { |
|
34 | options: { |
34 | options: { |
|
35 | curly: true, |
35 | curly: true, |
|
36 | eqeqeq: true, |
36 | eqeqeq: true, |
|
37 | immed: true, |
37 | immed: true, |
|
38 | latedef: true, |
38 | latedef: true, |
|
39 | newcap: true, |
39 | newcap: true, |
|
40 | noarg: true, |
40 | noarg: true, |
|
41 | sub: true, |
41 | sub: true, |
|
42 | undef: true, |
42 | undef: true, |
|
43 | unused: false, |
43 | unused: false, |
|
44 | boss: true, |
44 | boss: true, |
|
45 | eqnull: true, |
45 | eqnull: true, |
|
46 | globals: { |
46 | globals: { |
|
47 | '$': false, |
47 | '$': false, |
|
48 | 'module': false |
48 | 'module': false, |
|
- | 49 | jQuery: true |
||
49 | }, |
50 | }, |
|
50 | // spread/rest operator |
51 | // spread/rest operator |
|
51 | esnext: true |
52 | esnext: true |
|
52 | }, |
53 | }, |
|
53 | gruntfile: { |
54 | gruntfile: { |
|
54 | src: 'Gruntfile.js' |
55 | src: 'Gruntfile.js' |
|
55 | }, |
56 | }, |
|
56 | lib_test: { |
57 | lib_test: { |
|
57 | src: ['lib/**/*.js', 'test/**/*.js'] |
58 | src: ['lib/**/*.js', 'test/**/*.js'] |
|
58 | } |
59 | } |
|
59 | }, |
60 | }, |
|
60 | nodeunit: { |
61 | nodeunit: { |
|
61 | files: ['test/**/*_test.js'] |
62 | files: ['test/**/*_test.js'] |
|
62 | }, |
63 | }, |
|
63 | watch: { |
64 | watch: { |
|
64 | gruntfile: { |
65 | gruntfile: { |
|
65 | files: '<%= jshint.gruntfile.src %>', |
66 | files: '<%= jshint.gruntfile.src %>', |
|
66 | tasks: ['jshint:gruntfile'] |
67 | tasks: ['jshint:gruntfile'] |
|
67 | }, |
68 | }, |
|
68 | lib_test: { |
69 | lib_test: { |
|
69 | files: '<%= jshint.lib_test.src %>', |
70 | files: '<%= jshint.lib_test.src %>', |
|
70 | tasks: ['jshint:lib_test', 'nodeunit'] |
71 | tasks: ['jshint:lib_test', 'nodeunit'] |
|
71 | } |
72 | } |
|
72 | } |
73 | } |
|
73 | }); |
74 | }); |
|
74 | |
75 | |
|
75 | // These plugins provide necessary tasks. |
76 | // These plugins provide necessary tasks. |
|
76 | grunt.loadNpmTasks('grunt-contrib-concat'); |
77 | grunt.loadNpmTasks('grunt-contrib-concat'); |
|
77 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
78 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
|
78 | //grunt.loadNpmTasks('grunt-contrib-nodeunit'); |
79 | //grunt.loadNpmTasks('grunt-contrib-nodeunit'); |
|
79 | grunt.loadNpmTasks('grunt-contrib-jshint'); |
80 | grunt.loadNpmTasks('grunt-contrib-jshint'); |
|
80 | grunt.loadNpmTasks('grunt-contrib-watch'); |
81 | grunt.loadNpmTasks('grunt-contrib-watch'); |
|
81 | |
82 | |
|
82 | // Default task. |
83 | // Default task. |
|
83 | grunt.registerTask( |
84 | grunt.registerTask( |
|
84 | 'default', |
85 | 'default', |
|
85 | [ |
86 | [ |
|
86 | 'jshint', |
87 | 'jshint', |
|
87 | //'nodeunit', |
88 | //'nodeunit', |
|
88 | 'concat', |
89 | 'concat', |
|
89 | 'uglify' |
90 | 'uglify' |
|
90 | ] |
91 | ] |
|
91 | ); |
92 | ); |
|
92 | |
93 | |
|
93 | }; |
94 | }; |
|
94 | |
95 | |