diff --git a/app/helpers/minify.php b/app/helpers/minify.php index f8cc500..3948b7a 100644 --- a/app/helpers/minify.php +++ b/app/helpers/minify.php @@ -71,7 +71,13 @@ function js( $dom=false, $file=false ){ // if no src add to the config file if( empty($src) && $data['require'] ) { - $client .= $script->textContent; + // #94 check dependencies + if( !empty( $data['deps'] ) ){ + $deps = explode(",", $data['deps']); + $client .= "require(". json_encode( $deps ) .", function(){ ". $script->textContent ." });"; + } else { + $client .= $script->textContent; + } // no further processing required continue; }