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

Can not resolve alias when using default import #20

Closed
qmhc opened this issue Aug 14, 2021 · 0 comments
Closed

Can not resolve alias when using default import #20

qmhc opened this issue Aug 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@qmhc
Copy link
Owner

qmhc commented Aug 14, 2021

source: import VContainer from '@components/layout/container/VContainer.vue'

outputs: import VContainer from '@components/layout/container/VContainer.vue'

correct outputs: import VContainer from './components/layout/container/VContainer.vue'

vite config:

{
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'),
      '@components': path.resolve(__dirname, 'src/components'),
    },
  }
}

Another issue:
When an alias is included by another alias and is in front of the another alias, can not resolve aliases correctly.
When an alias real dir path is using by a file which includes the alias real dir path, can not resolve aliases correctly.

origin: #19 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant