When we are running our site in debug mode without minifying the script this works:
var defines = [
'globals',
'templates'
];
define(defines, function(globals, templates) {
//code...
});
But as soon the code is minified it stops to work. Do you know why?
Please notice that this works:
define([
'globals',
'templates'
], function(globals, templates) {
//code...
});
The reason why we want to use an array is because we want to loop through it to replace 'template' with 'template.1010101010' where 10101010101 is a timestamp based on the creation of the file, maintaining the file like this enables us to automatically bypass the cache when the file is updated.
Please note that we have more files to loop through.