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.

asset filename hash options does not work on image

See original GitHub issue

Describe the bug

code

<img alt="Vue logo" src="../../assets/logo.png" />

vite.config.js

output:{
        entryFileNames: "[name]-HASH-[hash].js",
        assetFileNames:"[name]-HASH-[hash][extname]",
        chunkFileNames:"[name]-HASH-[hash].js"
      },

npm run build

logo.03d6d6da.png
vendor-HASH-74164848.js

Another asset files have -HASH- chunk, but logo.png does not -HASH- chunk.

Reproduction

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:


Used package manager:

Logs



Before submitting the issue, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the docs.
  • Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
  • Provide a description in this issue that describes the bug.
  • Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
patak-devcommented, Mar 23, 2021

@narusas please edit the description of this issue respecting the issue template, checking all checkboxes as required and adding the system info. You are also encouraged to include a minimal reproduction so it is easier to test. Thanks.

0reactions
patak-devcommented, Mar 26, 2021

@Linrstudio @zerofairnight could you provide a minimal reproduction so it is easier for others to debug this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options for assets building without adding hash #378
All referenced assets, including those using absolute paths, will be copied to the dist folder with a hashed file name in the production...
Read more >
How to prevent generating hashed broken assets (Image ...
Anyway in the new webpack there's no need for file loader for images as shown in ... this should fix the linking, broken...
Read more >
Adding Hashes to Filenames
The problem is detecting the case and dealing with it. ... According to Steve Souders, attaching the hash to the filename is the...
Read more >
css-loader | webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
HTML and Static Assets
Result filenames include content hashes so you don't need to worry about browsers caching their old versions. The public directory is provided ...
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