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

wildcard and resolve.alias can't work at the same time #31

Open
KumaCool opened this issue Mar 3, 2019 · 1 comment
Open

wildcard and resolve.alias can't work at the same time #31

KumaCool opened this issue Mar 3, 2019 · 1 comment

Comments

@KumaCool
Copy link

KumaCool commented Mar 3, 2019

wildcard and resolve.alias can't work at the same time
my project is built with VueCli3
webpack set the resolve.alias '@'
folder:

src/
├─ views/
│   ├─ index.vue
│   ├─ test.vue

code:

import { Index as temp } from '@/views/*';
console.log(temp);

error:Uncaught Error: Cannot find module '@/views/*'

@vihanb
Copy link
Owner

vihanb commented May 15, 2019

I don't know about webpack resolve.alias specifically but for this I use: https://www.npmjs.com/package/babel-plugin-root-import which is babel plugin that makes babel resolve the @ path. (There's also https://www.npmjs.com/package/babel-plugin-module-resolver which is popular but I don't use that one personally)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants