Require.js Not Updating in Browser
javascript, requirejs
Solution
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.
Problem
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!