WordPress具有可在wp配置中定义的常量。php。Have a read here
像这样的事情可能会有帮助
//setup the production names for the files
$js_file = \'scripts.min.js\';
$css_file = \'styles-compressed.css\';
//check for WP_DEBUG constant status
if( defined( \'WP_DEBUG\' ) && WP_DEBUG ) {
//check for SCRIPT_DEBUG constant status
if( defined( \'SCRIPT_DEBUG\' ) && SCRIPT_DEBUG ) {
$js_file = \'scripts.js\';
$css_file = \'styles-development.css\';
}
}
//load the files
wp_enqueue_script( \'plugin_scripts\', $basepath . \'/js/\' . $js_file );
wp_enqueue_style( \'plugin_styles\', $basepath . \'/css/\' . $css_file );