}
var fs = require( "fs" ),
- gzip = require( "gzip-js" ),
- oldNode = /^v0\./.test( process.version );
-
- // Support: Node.js <4
- // Skip running tasks that dropped support for Node.js 0.12
- // in this Node version.
- function runIfNewNode( task ) {
- return oldNode ? "print_old_node_message:" + task : task;
- }
+ gzip = require( "gzip-js" );
if ( !grunt.option( "filename" ) ) {
grunt.option( "filename", "jquery.js" );
} );
// Load grunt tasks from NPM packages
- // Support: Node.js <4
- // Don't load the eslint task in old Node.js, it won't parse.
- require( "load-grunt-tasks" )( grunt, {
- pattern: oldNode ? [ "grunt-*", "!grunt-eslint" ] : [ "grunt-*" ]
- } );
+ require( "load-grunt-tasks" )( grunt );
// Integrate jQuery specific tasks
grunt.loadTasks( "build/tasks" );
- grunt.registerTask( "print_old_node_message", function() {
- var task = [].slice.call( arguments ).join( ":" );
- grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
- } );
-
grunt.registerTask( "lint", [
"jsonlint",
// would run the dist target first which would point to errors in the built
// file, making it harder to fix them. We want to check the built file only
// if we already know the source files pass the linter.
- runIfNewNode( "eslint:dev" ),
- runIfNewNode( "eslint:dist" )
+ "eslint:dev",
+ "eslint:dist"
] );
grunt.registerTask( "lint:newer", [
"newer:jsonlint",
// Don't replace it with just the task; see the above comment.
- runIfNewNode( "newer:eslint:dev" ),
- runIfNewNode( "newer:eslint:dist" )
+ "newer:eslint:dev",
+ "newer:eslint:dist"
] );
- grunt.registerTask( "test:fast", runIfNewNode( "node_smoke_tests" ) );
- grunt.registerTask( "test:slow", runIfNewNode( "promises_aplus_tests" ) );
+ grunt.registerTask( "test:fast", "node_smoke_tests" );
+ grunt.registerTask( "test:slow", "promises_aplus_tests" );
grunt.registerTask( "test", [
"test:fast",
grunt.registerTask( "dev", [
"build:*:*",
- runIfNewNode( "newer:eslint:dev" ),
+ "newer:eslint:dev",
"newer:uglify",
"remove_map_comment",
"dist:*",
] );
grunt.registerTask( "default", [
- runIfNewNode( "eslint:dev" ),
+ "eslint:dev",
"build:*:*",
"uglify",
"remove_map_comment",
"dist:*",
- runIfNewNode( "eslint:dist" ),
+ "eslint:dist",
"test:fast",
"compare_size"
] );