MDL-43105 JavaScript: Use the correct versions of our rollups

This commit is contained in:
Andrew Nicols 2013-11-28 11:49:12 +08:00
parent f7434db109
commit 104d698ffd
2 changed files with 20 additions and 8 deletions

View file

@ -88,12 +88,13 @@ while (count($parts)) {
if (strpos($rollupname, 'yui-moodlesimple') !== false) {
if (substr($rollupname, -3) === '.js') {
// Determine whether we should minify this rollup.
preg_match('/(-min)?\.js/', $rollupname, $matches);
// Determine which version of this rollup should be used.
$filesuffix = '.js';
preg_match('/(-(debug|min))?\.js/', $rollupname, $matches);
if (isset($matches[1])) {
$filesuffix = '-min.js';
$filesuffix = $matches[0];
}
$type = 'js';
} else if (substr($rollupname, -4) === '.css') {
$type = 'css';
@ -216,9 +217,11 @@ while (count($parts)) {
'core/notification/notification-dialogue',
);
// Determine which version of this rollup should be used.
$filesuffix = '.js';
preg_match('/(-(debug|min))?\.js/', $rollupname, $matches);
if (isset($matches[1])) {
$filesuffix = '-min.js';
$filesuffix = $matches[0];
}
// We need to add these new parts to the beginning of the $parts list, not the end.