asset filename hash options does not work on image
See original GitHub issueDescribe 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:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
@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.
@Linrstudio @zerofairnight could you provide a minimal reproduction so it is easier for others to debug this issue?