Make WordPress Core

Ticket #31911: 31911.patch

File 31911.patch, 2.5 KB (added by iseulde, 10 years ago)
  • Gruntfile.js

     
    418418                                        '!wp-includes/js/zxcvbn.min.js'
    419419                                ]
    420420                        },
    421                         media: {
    422                                 expand: true,
    423                                 cwd: SOURCE_DIR,
    424                                 dest: BUILD_DIR,
    425                                 ext: '.min.js',
    426                                 src: [
    427                                         'wp-includes/js/media/audio-video.js',
    428                                         'wp-includes/js/media/grid.js',
    429                                         'wp-includes/js/media/models.js',
    430                                         'wp-includes/js/media/views.js'
    431                                 ]
    432                         },
    433421                        jqueryui: {
    434422                                options: {
    435423                                        preserveComments: 'some'
     
    525513                        all: {
    526514                                files: [
    527515                                        SOURCE_DIR + '**',
     516                                        '!' + SOURCE_DIR + 'wp-includes/js/media/**',
    528517                                        // Ignore version control directories.
    529518                                        '!' + SOURCE_DIR + '**/.{svn,git}/**'
    530519                                ],
     
    540529                                        SOURCE_DIR + 'wp-includes/js/media/*.js',
    541530                                        '!' + SOURCE_DIR + 'wp-includes/js/media/*.manifest.js'
    542531                                ],
    543                                 tasks: ['uglify:media']
     532                                tasks: ['copy:dynamic'],
     533                                options: {
     534                                        spawn: false
     535                                }
    544536                        },
    545537                        config: {
    546538                                files: 'Gruntfile.js'
     
    663655        // Default task.
    664656        grunt.registerTask('default', ['build']);
    665657
    666         // Add a listener to the watch task.
    667         //
    668         // On `watch:all`, automatically updates the `copy:dynamic` and `clean:dynamic`
    669         // configurations so that only the changed files are updated.
    670         // On `watch:rtl`, automatically updates the `rtlcss:dynamic` configuration.
    671         grunt.event.on('watch', function( action, filepath, target ) {
    672                 if ( target !== 'all' && target !== 'rtl' ) {
     658        /*
     659         * Automatically updates the `:dynamic` configurations
     660         * so that only the changed files are updated.
     661         */
     662        grunt.event.on( 'watch', function( action, filepath, target ) {
     663                var src;
     664
     665                if ( [ 'all', 'rtl', 'browserify' ].indexOf( target ) === -1 ) {
    673666                        return;
    674667                }
    675668
    676                 var relativePath = path.relative( SOURCE_DIR, filepath ),
    677                         cleanSrc = ( action === 'deleted' ) ? [relativePath] : [],
    678                         copySrc = ( action === 'deleted' ) ? [] : [relativePath];
    679 
    680                 grunt.config(['clean', 'dynamic', 'src'], cleanSrc);
    681                 grunt.config(['copy', 'dynamic', 'src'], copySrc);
    682                 grunt.config(['rtlcss', 'dynamic', 'src'], copySrc);
    683         });
     669                src = [ path.relative( SOURCE_DIR, filepath ) ];
     670
     671                if ( action === 'deleted' ) {
     672                        grunt.config( [ 'clean', 'dynamic', 'src' ], src );
     673                } else {
     674                        grunt.config( [ 'copy', 'dynamic', 'src' ], src );
     675
     676                        if ( target === 'rtl' ) {
     677                                grunt.config( [ 'rtlcss', 'dynamic', 'src' ], src );
     678                        }
     679                }
     680        } );
    684681};