How to add wildcard mapping in entry of webpack

前端 未结 5 1404
长发绾君心
长发绾君心 2020-12-04 16:50

I need to webpack all the js file in the script folder.I tried this

module.exports = {
  module: {
    loaders: [
      {
        test: /\\.js$/,
        ex         


        
5条回答
  •  情歌与酒
    2020-12-04 17:18

    Having one or few entry points should be enough for most of use cases, but if you really want to bundle up all files from directory you can use following:

    As explained here: https://github.com/webpack/webpack/issues/370

    var glob = require("glob");
    // ...
    entry: glob.sync("./src/scripts/*.js")
    

提交回复
热议问题