webstorm 不识别路径别名@

时间:2025-04-05 08:44:38
'use strict' const path = require('path') function resolve(dir) { return (__dirname, '.', dir) } = { context: (__dirname, './'), resolve: { extensions: ['.js', '.vue', '.json'], alias: { '@': resolve('src'), // '@assets': resolve('src/assets'), // '@layouts': resolve('src/layouts'), // '@pages': resolve('src/pages'), // '@comp': resolve('src/components'), // '@api': resolve('src/api'), // '@plug': resolve('src/plugins'), // '@utils': resolve('src/utils') } } }