2
我见过使用urlArgs来强制文件更改的许多解决方案,但是有没有一种有效的方法来让文件自动更改只有单个文件?RequireJS自动单个文件缓存胸围
是否有可能仅对已修改的文件进行缓存?
The biggest example being this topic.
function bust(path) {
return path + '?bust=' + (new Date()).getTime();
}
require.config({
baseUrl: '/base/path',
paths: {
'fileAlias': bust('fileLikelyToChange'),
'anotherFileAlias': bust('anotherFileLikelyToChange'),
'jQuery': 'jQuery'
},
});
问题是这样的解决方案,每次萧条的缓存,而不是只有当文件已被修改。
怎么能RequireJS知道文件是否被修改? – idbehold 2014-09-05 19:24:52
你的问题是我的答案。 RequireJS似乎没有可行的方法。试图寻找可能没有的解决方案。 :/ – nicholinde 2014-09-05 19:33:45