question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rev issue: index.html not updated

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AStokercommented, Mar 3, 2017

That’s pretty much what I did (slightly modified). Check out the PR referenced: https://github.com/aurelia/cli/issues/515

0reactions
tdamircommented, Mar 3, 2017

@AStoker Thanks for the fix!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found