Ticket #25187: 25187.4.diff
File 25187.4.diff, 3.9 KB (added by , 11 years ago) |
---|
-
.jshintrc
1 { 2 "curly": true, 3 "eqeqeq": true, 4 "eqnull": true, 5 "expr": true, 6 "immed": true, 7 "noarg": true, 8 "quotmark": "single", 9 "smarttabs": true, 10 "trailing": true, 11 "undef": true, 12 "unused": true, 13 14 "browser": true, 15 16 "globals": { 17 "jQuery": false, 18 "wp": false 19 } 20 } -
Gruntfile.js
1 /* global module:false*/1 /* jshint node:true */ 2 2 module.exports = function(grunt) { 3 var path = require('path') ;4 var SOURCE_DIR = 'src/';5 varBUILD_DIR = 'build/';3 var path = require('path'), 4 SOURCE_DIR = 'src/', 5 BUILD_DIR = 'build/'; 6 6 7 7 // Load tasks. 8 8 require('matchdep').filterDev('grunt-*').forEach( grunt.loadNpmTasks ); … … 47 47 }, 48 48 version: { 49 49 options: { 50 processContent: function( src , filepath) {51 return src.replace( /^(\$wp_version.+?)-src';/m, "$1';");50 processContent: function( src ) { 51 return src.replace( /^(\$wp_version.+?)-src';/m, '$1\';' ); 52 52 } 53 53 }, 54 54 files: [ … … 80 80 ] 81 81 } 82 82 }, 83 jshint: { 84 options: grunt.file.readJSON('.jshintrc'), 85 grunt: { 86 files: { 87 src: ['Gruntfile.js'] 88 }, 89 options: { 90 onevar: true 91 } 92 }, 93 tests: { 94 files: { 95 src: [ 96 'tests/qunit/**/*.js', 97 '!tests/qunit/vendor/qunit.js' 98 ] 99 }, 100 options: grunt.file.readJSON('tests/qunit/.jshintrc') 101 }, 102 'wp-admin': { 103 files: { 104 src: [ 105 'src/wp-admin/js/**/*.js', 106 '!src/wp-admin/js/farbtastic.js', 107 '!src/wp-admin/js/iris.min.js' 108 ] 109 } 110 }, 111 'wp-includes': { 112 files: { 113 src: [ 114 'src/wp-includes/js/**/*.js', 115 // 3rd-Party Scripts 116 '!src/wp-includes/js/backbone.min.js', 117 '!src/wp-includes/js/colorpicker.js', 118 '!src/wp-includes/js/crop/**/*.js', 119 '!src/wp-includes/js/hoverIntent.js', 120 '!src/wp-includes/js/imgareaselect/**/*.js', 121 '!src/wp-includes/js/jcrop/**/*.js', 122 '!src/wp-includes/js/jquery/**/*.js', 123 '!src/wp-includes/js/json2.js', 124 '!src/wp-includes/js/mediaelement/**/*.js', 125 '!src/wp-includes/js/plupload/**/*.js', 126 '!src/wp-includes/js/swfobject.js', 127 '!src/wp-includes/js/swfupload/**/*.js', 128 '!src/wp-includes/js/thickbox/**/*.js', 129 '!src/wp-includes/js/tinymce/**/*.js', 130 '!src/wp-includes/js/tw-sack.js', 131 '!src/wp-includes/js/underscore.min.js', 132 '!src/wp-includes/js/zxcvbn.min.js' 133 ] 134 } 135 } 136 }, 83 137 qunit: { 84 138 files: ['tests/qunit/**/*.html'] 85 139 }, … … 194 248 // On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic` 195 249 // configurations so that only the changed files are updated. 196 250 grunt.event.on('watch', function( action, filepath, target ) { 197 if ( target != 'all' )251 if ( target !== 'all' ) { 198 252 return; 253 } 199 254 200 var relativePath = path.relative( SOURCE_DIR, filepath ) ;201 var cleanSrc = ( action == 'deleted' ) ? [relativePath] : [];202 var copySrc = ( action== 'deleted' ) ? [] : [relativePath];255 var relativePath = path.relative( SOURCE_DIR, filepath ), 256 cleanSrc = ( action === 'deleted' ) ? [relativePath] : [], 257 copySrc = ( action === 'deleted' ) ? [] : [relativePath]; 203 258 204 259 grunt.config(['clean', 'dynamic', 'src'], cleanSrc); 205 260 grunt.config(['copy', 'dynamic', 'src'], copySrc); -
package.json
18 18 "grunt-contrib-watch": "~0.5.1", 19 19 "grunt-contrib-compress": "~0.5.2", 20 20 "grunt-contrib-concat": "~0.3.0", 21 "grunt-contrib-jshint": "~0.7.0", 21 22 "matchdep": "~0.1.2" 22 23 } 23 24 }