1 module.exports = function( grunt ) {
4 function readOptionalJSON( filepath ) {
5 var stripJSONComments = require( "strip-json-comments" ),
8 data = JSON.parse( stripJSONComments(
9 fs.readFileSync( filepath, { encoding: "utf8" } )
15 var fs = require( "fs" ),
16 gzip = require( "gzip-js" );
18 if ( !grunt.option( "filename" ) ) {
19 grunt.option( "filename", "jquery.js" );
23 pkg: grunt.file.readJSON( "package.json" ),
24 dst: readOptionalJSON( "dist/.destination.json" ),
26 files: [ "dist/jquery.js", "dist/jquery.min.js" ],
29 gz: function( contents ) {
30 return gzip.zip( contents, {} ).length;
33 cache: "build/.sizecache.json"
43 "test/node_smoke_tests/lib/ensure_iterability.js":
44 "test/node_smoke_tests/lib/ensure_iterability_es6.js"
50 dest: "dist/jquery.js",
56 // Exclude specified modules if the module matching the key is removed
58 ajax: [ "manipulation/_evalUrl", "event/ajax" ],
59 callbacks: [ "deferred" ],
60 css: [ "effects", "dimensions", "offset" ],
61 "css/showHide": [ "effects" ],
63 remove: [ "ajax", "effects", "queue", "core/ready" ],
64 include: [ "core/ready-no-deferred" ]
66 sizzle: [ "css/hiddenVisibleSelectors", "effects/animatedSelector" ]
73 destPrefix: "external"
76 "sizzle/dist": "sizzle/dist",
77 "sizzle/LICENSE.txt": "sizzle/LICENSE.txt",
79 "npo/npo.js": "native-promise-only/npo.js",
81 "qunit/qunit.js": "qunitjs/qunit/qunit.js",
82 "qunit/qunit.css": "qunitjs/qunit/qunit.css",
83 "qunit/LICENSE.txt": "qunitjs/LICENSE.txt",
85 "qunit-assert-step/qunit-assert-step.js":
86 "qunit-assert-step/qunit-assert-step.js",
87 "qunit-assert-step/MIT-LICENSE.txt":
88 "qunit-assert-step/MIT-LICENSE.txt",
90 "requirejs/require.js": "requirejs/require.js",
92 "sinon/sinon.js": "sinon/pkg/sinon.js",
93 "sinon/LICENSE.txt": "sinon/LICENSE"
99 src: [ "package.json" ]
105 // See https://github.com/sindresorhus/grunt-eslint/issues/119
109 // We have to explicitly declare "src" property otherwise "newer"
110 // task wouldn't work properly :/
112 src: "dist/jquery.js"
115 src: [ "src/**/*.js", "Gruntfile.js", "test/**/*.js", "build/**/*.js" ]
121 // A special module with basic tests, meant for
122 // not fully supported environments like Android 2.3,
123 // jsdom or PhantomJS. We run it everywhere, though,
124 // to make sure tests are not broken.
150 files: [ "<%= eslint.dev.src %>" ],
156 "dist/<%= grunt.option('filename').replace('.js', '.min.js') %>":
157 "dist/<%= grunt.option('filename') %>"
160 preserveComments: false,
164 "dist/<%= grunt.option('filename').replace('.js', '.min.map') %>",
169 banner: "/*! jQuery v<%= pkg.version %> | " +
170 "(c) JS Foundation and other contributors | jquery.org/license */",
181 // Load grunt tasks from NPM packages
182 require( "load-grunt-tasks" )( grunt );
184 // Integrate jQuery specific tasks
185 grunt.loadTasks( "build/tasks" );
187 grunt.registerTask( "lint", [
190 // Running the full eslint task without breaking it down to targets
191 // would run the dist target first which would point to errors in the built
192 // file, making it harder to fix them. We want to check the built file only
193 // if we already know the source files pass the linter.
198 grunt.registerTask( "lint:newer", [
201 // Don't replace it with just the task; see the above comment.
206 grunt.registerTask( "test:fast", "node_smoke_tests" );
207 grunt.registerTask( "test:slow", "promises_aplus_tests" );
209 grunt.registerTask( "test", [
214 grunt.registerTask( "dev", [
218 "remove_map_comment",
223 grunt.registerTask( "default", [
227 "remove_map_comment",