Support `@/` -> src folder alias to keep consistant with vue-cli
See original GitHub issueIs your feature request related to a problem? Please describe.
As the comment describes, when using directory mappings, the key must start and end with a slash
Describe the solution you’d like
Since @/ -> src folder
is a convention in vue-cli, it would be great to also add it to vite. It should be technically feasible because @/xx
is not a valid npm package name.
Describe alternatives you’ve considered
Therer is another option: /@/
, which matches the current rule.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Vue cli 3 project alias src to @ or ~/ not working - Stack Overflow
It's built in to the CLI, can you try import Component from '@/components/folder/Component.vue' ? – Alexander Staroselsky. Mar 23, 2019 at 3:35.
Read more >Renaming src Folder of a Vue CLI 3 Project
Source files in a Vue CLI 3 project are contained in the folder src. This article discusses whether or not you should change...
Read more >Configuration Reference | Vue CLI
The directory where the production build files will be generated in when running vue-cli-service build . Note the target directory contents ...
Read more >How to Migrate from Vue CLI to Vite - Vue School Blog
Learn how to migrate from Vue CLI to Vite in 9 simple steps for a faster and more streamlined developer experience.
Read more >Dependency resolution - Parcel
In JavaScript, Typescript, and other JS-based languages, dependency specifiers may resolve to a directory rather than a file. If the directory contains a ......
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
My workaround is as follows:
vite.config.ts
how to make this work when using sass ? specially the ~ imports