question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[suggestion] Alias for "@" to 'src' by default

See original GitHub issue

Describe the solution you’d like Having alias for @ to src by default since we already have it in Vue CLI and Nuxt.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Jan 14, 2021

I’ll leave it for those who might need it

// vite.config.js
import vue from '@vitejs/plugin-vue'
import path from 'path'

/**
 * @type {import('vite').UserConfig}
 */
export default {
  plugins: [vue()],
  alias: {
    '@': path.resolve(__dirname, '/src')
  }
}
1reaction
ghostcommented, Jan 28, 2021

Add .vue extension to those imports

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module Resolution or Import Alias: The Final Guide - Raul Melo
This is a very basic setup where: We have our src (source) which holds our app code;; src/components which holds all our app...
Read more >
Path aliases for imports in WebStorm - Stack Overflow
We have A B and C folders declared as alias in Webpack. And in Webstorm we marked "src" as "Resource Root". And now...
Read more >
Create Path Aliases in React - DEV Community ‍ ‍
The goal is to provide path aliases for a react project. This makes code look cleaner and easier to understand. ... import Header...
Read more >
How to use module path aliases in Visual Studio Code ...
In this article I'll tell you how I fixed my Node.js development environment to be able to use a “macro” reference (or an...
Read more >
30 Handy Bash Shell Aliases For Linux / Unix / MacOS - nixCraft
By default alias command shows a list of aliases that are defined for the current user. How to define or create a bash...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found