vue.config.js 配置 别名(alias)

const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    configureWebpack: {
        resolve: {
            alias: {
                '@': resolve('src'),
                '@api': resolve('src/api/models'),
                '@style': resolve('src/assets/less')
            }
        }
    }
}

posted @ 2021-10-08 15:44  柯宝宝智商感人  阅读(720)  评论(0编辑  收藏  举报