I tried to inject the non-dev nocache.js into my main index.html file. Like this:
String gwtNoCacheJs = loadFileFromServlet("/dt/dt.nocache.js");
if (gwtNoCacheJs.contains("superdevmode")) {
gwtNoCacheJs = "<script type='text/javascript' src='/dt/dt.nocache.js'></script>";
}
else {
gwtNoCacheJs = "<script type='text/javascript'>\n" + gwtNoCacheJs + "\n</script>";
}
String html = loadFile("index.html").replace("XXX", gwtNoCacheJs);
However, it doesn't work, as nocache.js wants to load files from the same sub directory it's located in, and not the root directory.
Has anyone done this? It probably isn't work the effort, as it'll only save one network call, but I was curious if it's possible.