WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/23/2012 12:04:18 AM (9 years ago)
Author:
nacin
Message:

Switch to .min for compressed JS and CSS files.

  • This moves our "development" versions from .dev.js to .js (same for css).
  • The compressed version then moves from .js to .min.js (same for css).

By switching to the standard .min convention, it sets expectations for developers,
and works nicely with existing tools such as ack.

fixes #21633.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/script-loader.php

    r21591 r21592  
    5858    $scripts->default_dirs = array('/wp-admin/js/', '/wp-includes/js/');
    5959
    60     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
     60    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    6161
    6262    $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js" );
     
    461461    $styles->default_dirs = array('/wp-admin/', '/wp-includes/css/');
    462462
    463     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
    464 
    465     $rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'wplink', 'customize-controls' );
    466     // Any rtl stylesheets that don't have a .dev version for ltr
     463    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     464
     465    $rtl_styles = array( 'wp-admin', 'ie', 'media', 'admin-bar', 'customize-controls' );
     466    // Any rtl stylesheets that don't have a .min version
    467467    $no_suffix = array( 'farbtastic' );
    468468
     
    507507 */
    508508function wp_prototype_before_jquery( $js_array ) {
     509    if ( false === $prototype = array_search( 'prototype', $js_array, true ) )
     510        return $js_array;
     511
    509512    if ( false === $jquery = array_search( 'jquery', $js_array, true ) )
    510         return $js_array;
    511 
    512     if ( false === $prototype = array_search( 'prototype', $js_array, true ) )
    513513        return $js_array;
    514514
     
    576576
    577577        if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG )
    578             $url = preg_replace('/.css$|.css(?=\?)/', '.dev.css', $url);
     578            $url = preg_replace( '/.min.css$|.min.css(?=\?)/', '.css', $url );
    579579
    580580        if ( isset($parsed['query']) && $parsed['query'] ) {
Note: See TracChangeset for help on using the changeset viewer.