Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asset filename hash options does not work on image #2654

Closed
6 tasks
narusas opened this issue Mar 23, 2021 · 5 comments
Closed
6 tasks

asset filename hash options does not work on image #2654

narusas opened this issue Mar 23, 2021 · 5 comments

Comments

@narusas
Copy link

narusas commented Mar 23, 2021

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.
@patak-dev
Copy link
Member

@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.

@github-actions
Copy link

Hello @narusas. Please provide a online reproduction by codesandbox or a minimal GitHub repository. Issues labeled by need reproduction will be closed if no activities in 3 days.

@Linrstudio
Copy link

I have the same problem. Images still have hash.

@zerofairnight
Copy link

Currently, asset names are hardcoded, the asset plugin does not use the Rollup configuration:

`${basename.slice(0, -ext.length)}.${contentHash}${ext}`

@patak-dev
Copy link
Member

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

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants