Vue.js - Configuring WebStorm to set @ in path files to the src folder

For vue-cli3, you need to specify a full path to node_modules/@vue/cli-service/webpack.config.js as a webpack configuration file in Settings | Languages & Frameworks | JavaScript | Webpack.

Note that this only works for JavaScript; webpack aliases are not resolved when using components written in TypeScript, path mappings in tsconfig.json should be used instead


In phpstorm 2020.3.3, I could fix this by

  • Opening Settings > Languages & Frameworks > JavaScript > Webpack and choose "Automatically"
  • Once saved, this opens a popup asking to run webpack configuration. Click "Trust project and run"
  • Fixed!