Resolve alias using Laravel-Mix

Hello everybody,


I got this (shortened) mix-file (`webpack.mix.js`):

 

const mix = require('laravel-mix');
const path = require('path');

mix.webpackConfig({

resolve: {
extensions: ['.js', '.vue'],
alias: {
'~@': path.resolve(__dirname, 'resources/js/')
}
}
});


If I now import a component like this:

import MyComponent from "~@/components/MyComponent";

everything works fine - but there's only one catch. On macOS I cannot COMMAND + Click the component `MyComponent` to get to the component.

 

If I import the component like this, it works fine:

import MyComponent from "../../components/MyComponent";


and a COMMAND + Click brings me to `MyComponent.vue`

0

请先登录再写评论。