Alias not supported
Open
Nobody has claimed this yet.
v0
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 331
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 9
Description
If I use alias for images folder, it does not work.
https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-alias
nuxt.config.js:
import { resolve } from 'path'
export default {
alias: {
'myimages': resolve(__dirname, './assets/images'),
}
}
pages/index.vue:
<template>
<div>
<!-- it works -->
<img src="~myimages/pic.jpg >
<!-- it fails -->
<nuxt-img src="~myimages/pic.jpg >
</div>
</template>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the alias configuration in nuxt.config.js and compare how the working and failing examples in pages/index.vue resolve ~myimages/pic.jpg. Check the linked Nuxt alias documentation first; done means the alias works with as it does with , with coverage added if the existing project tests provide a relevant entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100