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) { ...@@ -54,23 +54,22 @@ module.exports = function (grunt) {
54 token = tokens[i]; 54 token = tokens[i];
55 ptr = ptr[token] || (ptr[token] = {}); 55 ptr = ptr[token] || (ptr[token] = {});
56 } 56 }
57 ptr[last] = paths[prop].replace(/^(?:.*\/)?([a-f0-9]+)\..*$/, '$1'); 57 ptr[last] = paths[prop].replace(/^(?:.*\/)?(?:([a-f0-9]+)\.)?.*$/, '$1');
58 } 58 }
59 return result; 59 return result;
60 } 60 }
61 var config = grunt.config('montyPython.config');
62 var featureFlags = grunt.config('montyPython.featureFlags'); 61 var featureFlags = grunt.config('montyPython.featureFlags');
63 var segment = {}, segments = {}; 62 var segment = {}, segments = {};
64 63
65 // --- 64 // ---
66 if (config.useRev) { 65 if (true) {
67 var prefix = grunt.template.process('dist/build/scripts/'); 66 var prefix = grunt.template.process('dist/build/scripts/');
68 var pattern = prefix + '**/*.{js,html}'; 67 var pattern = prefix + '**/*.{js,html}';
69 var files = grunt.file.expand(pattern); 68 var files = grunt.file.expand(pattern);
70 if (files.length) { 69 if (files.length) {
71 _.each(files, function(file) { 70 _.each(files, function(file) {
72 file = file.substring(prefix.length); 71 file = file.substring(prefix.length);
73 var res = file.match(/^(.*\/)?([0-9a-f]+)\.([^\/]+)\.([^\.]+)$/); 72 var res = file.match(/^(.*\/)?(?:([0-9a-f]+)\.)?([^\/]+)\.([^\.]+)$/);
74 if (!res) { 73 if (!res) {
75 return; 74 return;
76 } 75 }
...@@ -132,7 +131,7 @@ module.exports = function (grunt) { ...@@ -132,7 +131,7 @@ module.exports = function (grunt) {
132 ' for (prop in paths) {', 131 ' for (prop in paths) {',
133 ' value = paths[prop];', 132 ' value = paths[prop];',
134 ' if (typeof value === "string") {', 133 ' if (typeof value === "string") {',
135 ' result[prefix + prop] = prefix + value + "." + prop;', 134 ' result[prefix + prop] = prefix + (value ? (value + ".") : "") + prop;',
136 ' } else {', 135 ' } else {',
137 ' expandPaths(value, prefix + prop + "/", result);', 136 ' expandPaths(value, prefix + prop + "/", result);',
138 ' }', 137 ' }',
......