I am having some issues developing an application with require.js. Whenever I edit a javascript file and save it in my code editor, the browser doesn't seem to register the change. I can refresh the page, but it still runs the old code. The problem is fixed by closing the tab and going re-opening the page, but there must be an easier way to do this. Has anyone else ever had this problem, and how did you fix it?
Thanks in advance!
Add this to the file that you specify as data-main
(in most cases, main.js
). Add this at the very first line:
require.config({
urlArgs: "ts="+new Date().getTime()
});
Note that this should be removed for production.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With