How to setup PhpStorm / WebStorm to work with Vite aliases?
17:36 30 Mar 2021

Vite isn't supported by the PhpStorm / WebStorm yet, so given following Vite configuration:

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, '/src'),
    },
  },
});

it doesn't recognize the following import correctly:

import { getAllItems } from '@/api'

How can this be setup to work correctly?

phpstorm webstorm vite