webpack的path.resolve和path.join的区别

首先声明:记录学习过程中遇到的问题

小tips:path的join和resolve的使用区别

path.join最近在项目中的应用

// vue.config.js
function resolve(dir) {
  return path.join(__dirname, dir)
}
-------module.exports-----------
 chainWebpack(config){
    config.resolve.alias
    .set('components',resolve('src/components'))
  }

猜你喜欢

转载自blog.csdn.net/weixin_44194732/article/details/106077819