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", "event/ajax" ],
43 callbacks: [ "deferred" ],
44 css: [ "effects", "dimensions", "offset" ],
45 sizzle: [ "css/hiddenVisibleSelectors", "effects/animatedSelector" ]
52 destPrefix: "external"
55 "sizzle/dist": "sizzle/dist",
56 "sizzle/LICENSE.txt": "sizzle/LICENSE.txt",
58 "npo/npo.js": "native-promise-only/npo.js",
60 "qunit/qunit.js": "qunitjs/qunit/qunit.js",
61 "qunit/qunit.css": "qunitjs/qunit/qunit.css",
62 "qunit/LICENSE.txt": "qunitjs/LICENSE.txt",
64 "requirejs/require.js": "requirejs/require.js",
66 "sinon/fake_timers.js": "sinon/lib/sinon/util/fake_timers.js",
67 "sinon/LICENSE.txt": "sinon/LICENSE"
73 src: [ "package.json" ]
83 "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js"
90 src: "dist/jquery.js",
91 options: srcHintOptions
96 gruntfile: "Gruntfile.js",
98 // Right now, check only test helpers
99 test: [ "test/data/testrunner.js" ],
100 release: [ "build/*.js", "!build/release-notes.js" ],
101 tasks: "build/tasks/*.js"
125 files: [ "<%= jshint.all.src %>" ],
131 "dist/jquery.min.js": [ "dist/jquery.js" ]
134 preserveComments: false,
136 sourceMapName: "dist/jquery.min.map",
141 banner: "/*! jQuery v<%= pkg.version %> | " +
142 "(c) jQuery Foundation | jquery.org/license */",
153 // Load grunt tasks from NPM packages
154 require( "load-grunt-tasks" )( grunt );
156 // Integrate jQuery specific tasks
157 grunt.loadTasks( "build/tasks" );
159 grunt.registerTask( "lint", [ "jsonlint", "jshint", "jscs" ] );
161 grunt.registerTask( "test_fast", [ "node_smoke_tests" ] );
163 grunt.registerTask( "test", [ "test_fast", "promises_aplus_tests" ] );
165 // Short list as a high frequency watch task
166 grunt.registerTask( "dev", [ "build:*:*", "lint", "uglify", "remove_map_comment", "dist:*" ] );
168 grunt.registerTask( "default", [ "dev", "test_fast", "compare_size" ] );