webpack.config.js

// webpack.config.js
const path = require('path')
const glob = require('glob')

module.exports = {
  // 指定 packs 文件夹下的 js 文件作为入口文件
  // glob.sync 获取改文件夹内的所有js文件路径
  entry: glob.sync("./packs/*.js").reduce((entries, p) => {
    const name = path.basename(p, '.js') //获取路径的文件名 aaa/bbb.js => bbb
    return { ...entries, [name]: p }
  }, {}),
  ...
 }

https://blog.csdn.net/qq_41614928/article/details/112758437

相关文章:

  • 2022-12-23
  • 2021-06-08
  • 2022-01-03
  • 2022-12-23
  • 2022-02-14
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2021-12-04
  • 2021-10-14
  • 2021-11-07
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案