I'm using require.js and r.js to package my AMD modules. I'm using jquery & requirejs via the following syntax:
<script data-main=/js/client src=/js/external/require-jquery.js></script>
This all works great pre & post packaging, but I run into issues a lot where chrome & mobile safari hold on to the cached version of client.js. I'd like to add a cachebuster to client.js, but I can't seem to figure out how to do it using the above syntax.
I tried some variations of:
<script data-main=js/client.js?b=busted src=/js/external/require-jquery.js></script>
but now require tries to get client.js from /
, not /js
, so it 404s.
I also tried adding
urlArgs : bust=+new Date().getTime()
to require.config
, but it appears to have no effect.
I also tried adding the same value to app.build.js
, but when it's in there, r.js no longer concatenates my js files, just uglifies them.
What is the proper syntax to bust a require.js data-main script cache?