67944948 by Adam Heath

Generate the fixed require config even if useRev is turned off.

1 parent d800ecf5
......@@ -54,23 +54,22 @@ module.exports = function (grunt) {
token = tokens[i];
ptr = ptr[token] || (ptr[token] = {});
}
ptr[last] = paths[prop].replace(/^(?:.*\/)?([a-f0-9]+)\..*$/, '$1');
ptr[last] = paths[prop].replace(/^(?:.*\/)?(?:([a-f0-9]+)\.)?.*$/, '$1');
}
return result;
}
var config = grunt.config('montyPython.config');
var featureFlags = grunt.config('montyPython.featureFlags');
var segment = {}, segments = {};
// ---
if (config.useRev) {
if (true) {
var prefix = grunt.template.process('dist/build/scripts/');
var pattern = prefix + '**/*.{js,html}';
var files = grunt.file.expand(pattern);
if (files.length) {
_.each(files, function(file) {
file = file.substring(prefix.length);
var res = file.match(/^(.*\/)?([0-9a-f]+)\.([^\/]+)\.([^\.]+)$/);
var res = file.match(/^(.*\/)?(?:([0-9a-f]+)\.)?([^\/]+)\.([^\.]+)$/);
if (!res) {
return;
}
......@@ -132,7 +131,7 @@ module.exports = function (grunt) {
' for (prop in paths) {',
' value = paths[prop];',
' if (typeof value === "string") {',
' result[prefix + prop] = prefix + value + "." + prop;',
' result[prefix + prop] = prefix + (value ? (value + ".") : "") + prop;',
' } else {',
' expandPaths(value, prefix + prop + "/", result);',
' }',
......