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`
请先登录再写评论。
Resolving aliases from Laravel Mix webpack is not currently supported (https://youtrack.jetbrains.com/issue/WEB-42186)
See https://stackoverflow.com/questions/34943631/path-aliases-for-imports-in-webstorm/50159420#50159420 and https://youtrack.jetbrains.com/issue/WEB-42186#focus=Comments-27-3767174.0-0 for a workaround