rev issue: index.html not updated
See original GitHub issueI’m submitting a bug report
- Library Version: 0.25.0
Please tell us about your environment:
-
Operating System: Windows [10]
-
Node Version: 6.9.2
- NPM Version: 4.3.0
-
Browser: all
-
Language: all
Current behavior: If rev is enabled in aurelia.json, the bindle revisions are generated but index.html is not updated according to that.
Expected/desired behavior: It should replace the index.html like in previous version. I’ve looked at the source and it looks like index is replaced before the revisioned filename is generated. If I change the order, it works fine.
Original bundle.js (line: 182)
if (loaderOptions.configTarget === this.config.name) {
//Add to the config bundle the loader config and change the "index.html" to reference the appropriate config bundle
concat.add(undefined, this.writeLoaderCode(platform));
contents = concat.content;
let outputDir = platform.baseUrl || platform.output; //If we have a baseUrl, then the files are served from there, else it's the output
if (platform.index) {
this.setIndexFileConfigTarget(platform, path.posix.join(outputDir, bundleFileName));
}
}
if (buildOptions.rev) {
//Generate a unique hash based off of the bundle contents
this.hash = generateHash(concat.content);
bundleFileName = generateHashedPath(this.config.name, this.hash);
}
Modified version working as expected:
if (buildOptions.rev) {
//Generate a unique hash based off of the bundle contents
this.hash = generateHash(concat.content);
bundleFileName = generateHashedPath(this.config.name, this.hash);
}
if (loaderOptions.configTarget === this.config.name) {
//Add to the config bundle the loader config and change the "index.html" to reference the appropriate config bundle
concat.add(undefined, this.writeLoaderCode(platform));
contents = concat.content;
let outputDir = platform.baseUrl || platform.output; //If we have a baseUrl, then the files are served from there, else it's the output
if (platform.index) {
this.setIndexFileConfigTarget(platform, path.posix.join(outputDir, bundleFileName));
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Index.html reference not getting updated · Issue #64 - GitHub
My index file did get it's name updated: index.2e6ac32e.html But the references inside are incorrect. I see that the references in my css ......
Read more >Browsers does not reflects updates in the code - html
I know this is a very old topic, but Firefox still fails to show code changes after refreshing a page, then viewing the...
Read more >Manual of Patent Examining Procedure (MPEP) - USPTO
The updated sections have a revision indicator of [R-10.2019], meaning these sections have been updated to reflect USPTO patent practice and relevant case...
Read more >Links in HTML documents - W3C
The rel attribute specifies the relationship of the linked document with the current document. The values "Index", "Next", and "Prev" are explained in...
Read more >Vim saved file not updating on webpage - Unix Stack Exchange
If this is the case, use ":recover" or "vim -r index.html" to recover the changes (see ":help recovery"). If you did this already,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s pretty much what I did (slightly modified). Check out the PR referenced: https://github.com/aurelia/cli/issues/515
@AStoker Thanks for the fix!