Ticket #25187: 25187.2.diff
File 25187.2.diff, 3.8 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 } -
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 }, 90 tests: { 91 files: { 92 src: [ 93 'tests/qunit/**/*.js', 94 '!tests/qunit/vendor/qunit.js' 95 ] 96 }, 97 options: grunt.file.readJSON('tests/qunit/.jshintrc') 98 }, 99 'wp-admin': { 100 files: { 101 src: [ 102 'src/wp-admin/js/**/*.js', 103 '!src/wp-admin/js/farbtastic.js', 104 '!src/wp-admin/js/iris.min.js' 105 ] 106 } 107 }, 108 'wp-includes': { 109 files: { 110 src: [ 111 'src/wp-includes/js/**/*.js', 112 // 3rd-Party Scripts 113 '!src/wp-includes/js/backbone.min.js', 114 '!src/wp-includes/js/colorpicker.js', 115 '!src/wp-includes/js/crop/**/*.js', 116 '!src/wp-includes/js/hoverIntent.js', 117 '!src/wp-includes/js/imgareaselect/**/*.js', 118 '!src/wp-includes/js/jcrop/**/*.js', 119 '!src/wp-includes/js/jquery/**/*.js', 120 '!src/wp-includes/js/json2.js', 121 '!src/wp-includes/js/mediaelement/**/*.js', 122 '!src/wp-includes/js/plupload/**/*.js', 123 '!src/wp-includes/js/swfobject.js', 124 '!src/wp-includes/js/swfupload/**/*.js', 125 '!src/wp-includes/js/thickbox/**/*.js', 126 '!src/wp-includes/js/tinymce/**/*.js', 127 '!src/wp-includes/js/tw-sack.js', 128 '!src/wp-includes/js/underscore.min.js', 129 '!src/wp-includes/js/zxcvbn.min.js' 130 ] 131 } 132 } 133 }, 83 134 qunit: { 84 135 files: ['tests/qunit/**/*.html'] 85 136 }, … … 194 245 // On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic` 195 246 // configurations so that only the changed files are updated. 196 247 grunt.event.on('watch', function( action, filepath, target ) { 197 if ( target != 'all' )248 if ( target !== 'all' ) { 198 249 return; 250 } 199 251 200 var relativePath = path.relative( SOURCE_DIR, filepath ) ;201 var cleanSrc = ( action == 'deleted' ) ? [relativePath] : [];202 var copySrc = ( action== 'deleted' ) ? [] : [relativePath];252 var relativePath = path.relative( SOURCE_DIR, filepath ), 253 cleanSrc = ( action === 'deleted' ) ? [relativePath] : [], 254 copySrc = ( action === 'deleted' ) ? [] : [relativePath]; 203 255 204 256 grunt.config(['clean', 'dynamic', 'src'], cleanSrc); 205 257 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 }