VUE 别名配置

2021-01-30  本文已影响0人  抽疯的稻草绳
image.png
const path = require('path')
function resolve(dir) {
 return path.join(__dirname, dir)
}
module.exports = {
 lintOnSave: true,
 chainWebpack: config => {
  config.resolve.alias
   .set('@', resolve('src'))
   .set('assets', resolve('src/assets'))
   .set('components', resolve('src/components'))
   .set('layout', resolve('src/layout'))
 }
}
上一篇 下一篇

猜你喜欢

热点阅读