Skip to content

Commit

Permalink
docs(assets): update static asset URL transformation in dev (vitejs#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
onildof authored Dec 2, 2024
1 parent 5c02236 commit 3ffcb18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guide/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import imgUrl from './img.png'
document.getElementById('hero-img').src = imgUrl
```

For example, `imgUrl` will be `/img.png` during development, and become `/assets/img.2d8efhg.png` in the production build.
For example, `imgUrl` will be `/src/img.png` during development, and become `/assets/img.2d8efhg.png` in the production build.

The behavior is similar to webpack's `file-loader`. The difference is that the import can be either using absolute public paths (based on project root during dev) or relative paths.

Expand Down

0 comments on commit 3ffcb18

Please sign in to comment.