const path = require('path');

module.exports = {//输出配置项
entry: './src/main.js',//入口
output: {//输出
publicPath: '/dist',
filename: 'bundle.js',
path: path.resolve(__dirname,'dist')
}
}
 
path是node.js的一个路径处理模块,不仅仅有path.resolve还有path.join等处理路径的方式,path.resolve操作类似于cd操作,就是一步一步查找,而__dirname则是获得当前文件所在目录的完整路径名

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2022-02-26
相关资源
相似解决方案