1.1. 配置webpack.config.js文件
/*为了webstorm识别vite中设置的别名*/ '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'), '@pages': path.resolve(__dirname, 'src/pages'), '@comp': path.resolve(__dirname, 'src/components'), '@api': path.resolve(__dirname, 'src/api'), '@plug': path.resolve(__dirname, 'src/plugins'), '@utils': path.resolve(__dirname, 'src/utils') } } }
1.2. 在webstorm设置中指定配置文件
webstorm可以识别@符号,按住Ctrl+路径也可以正常跳转了
标签:__,src,vue,ctrl,webstorm,resolve,跳转,path,dirname From: https://www.cnblogs.com/sdlz/p/18588620