Changeset 25188
- Timestamp:
- 08/30/2013 10:16:43 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Gruntfile.js
r25178 r25188 15 15 src: [] 16 16 }, 17 tinymce: { 18 src: [ 19 '<%= concat.tinymce.dest %>', 20 BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce-schema.min.js', 21 BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js' 22 ] 23 } 17 24 }, 18 25 copy: { … … 69 76 'wp-includes/js/plupload/wp-plupload.js', 70 77 'wp-includes/js/tinymce/plugins/wp*/js/*.js', 78 'wp-includes/js/tinymce/wp-tinymce-schema.js', 71 79 // Exceptions 72 80 '!wp-admin/js/custom-header.js', // Why? We should minify this. … … 76 84 '!wp-includes/js/swfobject.js', 77 85 '!wp-includes/js/underscore.min.js', 78 '!wp-includes/js/zxcvbn.min.js' 86 '!wp-includes/js/zxcvbn.min.js', 87 // Hard-coded in editimage.html 88 '!wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js' 79 89 ] 80 90 }, … … 85 95 src: [ 86 96 'wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js', 87 'wp-includes/js/tinymce/plugins/wp*/editor_plugin_src.js' 97 'wp-includes/js/tinymce/plugins/wp*/editor_plugin_src.js', 98 'wp-includes/js/tinymce/mark_loaded_src.js' 88 99 ], 89 100 // TinyMCE plugins use a nonstandard naming scheme: plugin files are named 90 101 // `editor_plugin_src.js`, and are compressed into `editor_plugin.js`. 91 102 rename: function(destBase, destPath) { 92 destPath = destPath.replace( '/editor_plugin_src.js', '/editor_plugin.js');103 destPath = destPath.replace(/_src.js$/, '.js'); 93 104 return path.join(destBase || '', destPath); 94 105 } 106 } 107 }, 108 concat: { 109 tinymce: { 110 options: { 111 separator: '\n', 112 banner: '// Created: <%= grunt.template.today("UTC:yyyy-mm-dd HH:MM:ss Z") %>\n', 113 process: function( src, filepath ) { 114 return '// Source: ' + filepath.replace( BUILD_DIR, '' ) + '\n' + src; 115 } 116 }, 117 src: [ 118 BUILD_DIR + 'wp-includes/js/tinymce/tiny_mce.js', 119 BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce-schema.min.js', 120 BUILD_DIR + 'wp-includes/js/tinymce/themes/advanced/editor_template.js', 121 BUILD_DIR + 'wp-includes/js/tinymce/plugins/*/editor_plugin.js', 122 BUILD_DIR + 'wp-includes/js/tinymce/mark_loaded.js' 123 ], 124 dest: BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce.js' 125 } 126 }, 127 compress: { 128 tinymce: { 129 options: { 130 mode: 'gzip', 131 level: 9 132 }, 133 src: '<%= concat.tinymce.dest %>', 134 dest: BUILD_DIR + 'wp-includes/js/tinymce/wp-tinymce.js.gz' 95 135 } 96 136 }, … … 123 163 grunt.loadNpmTasks('grunt-contrib-uglify'); 124 164 grunt.loadNpmTasks('grunt-contrib-watch'); 165 grunt.loadNpmTasks('grunt-contrib-compress'); 166 grunt.loadNpmTasks('grunt-contrib-concat'); 125 167 126 168 // Register tasks. 127 grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 128 'uglify: core', 'uglify:tinymce']);169 grunt.registerTask('build', ['clean:all', 'copy:all', 'cssmin:core', 'uglify:core', 170 'uglify:tinymce', 'concat:tinymce', 'compress:tinymce', 'clean:tinymce']); 129 171 130 172 // Testing task. … … 138 180 // On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic` 139 181 // configurations so that only the changed files are updated. 140 grunt.event.on('watch', function(action, filepath, target) { 141 if (target != 'all') return; 182 grunt.event.on('watch', function( action, filepath, target ) { 183 if ( target != 'all' ) 184 return; 142 185 143 var relativePath = path.relative(SOURCE_DIR, filepath); 144 var cleanSrc = (action == 'deleted') ? [relativePath] : []; 145 var copySrc = (action == 'deleted') ? [] : [relativePath]; 186 var relativePath = path.relative( SOURCE_DIR, filepath ); 187 var cleanSrc = ( action == 'deleted' ) ? [relativePath] : []; 188 var copySrc = ( action == 'deleted' ) ? [] : [relativePath]; 189 146 190 grunt.config(['clean', 'dynamic', 'src'], cleanSrc); 147 191 grunt.config(['copy', 'dynamic', 'src'], copySrc); -
trunk/package.json
r25178 r25188 16 16 "grunt-contrib-qunit": "~0.2.2", 17 17 "grunt-contrib-uglify": "~0.2.2", 18 "grunt-contrib-watch": "~0.5.1" 18 "grunt-contrib-watch": "~0.5.1", 19 "grunt-contrib-compress": "~0.5.2", 20 "grunt-contrib-concat": "~0.3.0" 19 21 } 20 22 }
Note: See TracChangeset
for help on using the changeset viewer.