was.js – Diff between revs 2 and 17

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 2 Rev 17
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 %>.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/<%= pkg.name %>.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 } 48 },
-   49 // spread/rest operator
-   50 esnext: true
49 }, 51 },
50 gruntfile: { 52 gruntfile: {
51 src: 'Gruntfile.js' 53 src: 'Gruntfile.js'
52 }, 54 },
53 lib_test: { 55 lib_test: {
54 src: ['lib/**/*.js', 'test/**/*.js'] 56 src: ['lib/**/*.js', 'test/**/*.js']
55 } 57 }
56 }, 58 },
57 nodeunit: { 59 nodeunit: {
58 files: ['test/**/*_test.js'] 60 files: ['test/**/*_test.js']
59 }, 61 },
60 watch: { 62 watch: {
61 gruntfile: { 63 gruntfile: {
62 files: '<%= jshint.gruntfile.src %>', 64 files: '<%= jshint.gruntfile.src %>',
63 tasks: ['jshint:gruntfile'] 65 tasks: ['jshint:gruntfile']
64 }, 66 },
65 lib_test: { 67 lib_test: {
66 files: '<%= jshint.lib_test.src %>', 68 files: '<%= jshint.lib_test.src %>',
67 tasks: ['jshint:lib_test', 'nodeunit'] 69 tasks: ['jshint:lib_test', 'nodeunit']
68 } 70 }
69 } 71 }
70 }); 72 });
71   73  
72 // These plugins provide necessary tasks. 74 // These plugins provide necessary tasks.
73 grunt.loadNpmTasks('grunt-contrib-concat'); 75 grunt.loadNpmTasks('grunt-contrib-concat');
74 grunt.loadNpmTasks('grunt-contrib-uglify'); 76 grunt.loadNpmTasks('grunt-contrib-uglify');
75 //grunt.loadNpmTasks('grunt-contrib-nodeunit'); 77 //grunt.loadNpmTasks('grunt-contrib-nodeunit');
76 grunt.loadNpmTasks('grunt-contrib-jshint'); 78 grunt.loadNpmTasks('grunt-contrib-jshint');
77 grunt.loadNpmTasks('grunt-contrib-watch'); 79 grunt.loadNpmTasks('grunt-contrib-watch');
78   80  
79 // Default task. 81 // Default task.
80 grunt.registerTask( 82 grunt.registerTask(
81 'default', 83 'default',
82 [ 84 [
83 'jshint', 85 'jshint',
84 //'nodeunit', 86 //'nodeunit',
85 'concat', 87 'concat',
86 'uglify' 88 'uglify'
87 ] 89 ]
88 ); 90 );
89   91  
90 }; 92 };
91   93