webstorm识别webpack别名

webstorm识别webpack别名

重装webstorm发现之前配置过的别名识别无了,跳转也跳转不了,在此记录一下

你是否烦恼于设置别名后,webstorm警告并且无法跳转的问题

image-20201216210710111

步骤

  1. 首先创建一个文件webstorm.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict'
const path = require('path')

module.exports = {
context: path.resolve(__dirname, './'),
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': path.resolve('src'),
'@assets': path.resolve(__dirname, 'src/assets'),
"@components": path.resolve("src/components"),
}
}
}
  1. 然后进入webstorm设置

image-20201216205942930

然后我们就可以愉快的进行跳转了

image-20201216210918827

作者

Liang

发布于

2020-12-16

更新于

2021-12-25

许可协议


评论