1 module.exports = function( grunt ) {
4 function readOptionalJSON( filepath ) {
7 data = grunt.file.readJSON( filepath );
12 var gzip = require( "gzip-js" ),
13 srcHintOptions = readOptionalJSON( "src/.jshintrc" );
15 // The concatenated file won't pass onevar
16 // But our modules can
17 delete srcHintOptions.onevar;
20 pkg: grunt.file.readJSON( "package.json" ),
21 dst: readOptionalJSON( "dist/.destination.json" ),
23 files: [ "dist/jquery.js", "dist/jquery.min.js" ],
26 gz: function( contents ) {
27 return gzip.zip( contents, {} ).length;
30 cache: "build/.sizecache.json"
35 dest: "dist/jquery.js",
40 // Exclude specified modules if the module matching the key is removed
42 ajax: [ "manipulation/_evalUrl" ],
43 callbacks: [ "deferred" ],
44 css: [ "effects", "dimensions", "offset" ],
45 sizzle: [ "css/hiddenVisibleSelectors", "effects/animatedSelector" ]
55 "src/sizzle/dist": "sizzle/dist",
56 "src/sizzle/test/data": "sizzle/test/data",
57 "src/sizzle/test/unit": "sizzle/test/unit",
58 "src/sizzle/test/index.html": "sizzle/test/index.html",
59 "src/sizzle/test/jquery.js": "sizzle/test/jquery.js"
64 destPrefix: "test/libs"
67 "qunit": "qunit/qunit",
68 "require.js": "requirejs/require.js",
69 "sinon/fake_timers.js": "sinon/lib/sinon/util/fake_timers.js"
75 src: [ "package.json" ]
89 "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/tasks/*",
90 "build/{bower-install,release-notes,release}.js"
97 src: "dist/jquery.js",
98 options: srcHintOptions
103 gruntfile: "Gruntfile.js",
104 tasks: "build/tasks/*.js"
107 tests: "ajax attributes callbacks core css data deferred dimensions effects event manipulation offset queue selector serialize support traversing Sizzle".split( " " )
110 files: [ "<%= jshint.all.src %>" ],
116 "dist/jquery.min.js": [ "dist/jquery.js" ]
119 preserveComments: false,
120 sourceMap: "dist/jquery.min.map",
121 sourceMappingURL: "jquery.min.map",
126 banner: "/*! jQuery v<%= pkg.version %> | " +
127 "(c) 2005, <%= grunt.template.today('yyyy') %> jQuery Foundation, Inc. | " +
128 "jquery.org/license */",
139 // Load grunt tasks from NPM packages
140 require( "load-grunt-tasks" )( grunt );
142 // Integrate jQuery specific tasks
143 grunt.loadTasks( "build/tasks" );
145 // Alias bower to bowercopy
146 grunt.registerTask( "bower", "bowercopy" );
148 // Short list as a high frequency watch task
149 grunt.registerTask( "dev", [ "build:*:*", "jshint", "jscs" ] );
152 grunt.registerTask( "default", [ "jsonlint", "dev", "uglify", "dist:*", "compare_size" ] );