確保在項目更目錄下面的Vue.config.js文件有以下配置
const path = require('path') function resolve(dir) { return path.join(__dirname, dir) } module.exports = { //... configureWebpack: { //... resolve: { alias: { '@': resolve('src') } } //... } //... }
在 webstorm File > Settings > Languages & Frameworks > JavaScript > Webpack 下選擇當前項目下的 "node_modules/@vue/cli-service/webpack.config.js"