Minify multiple javascript files with webpack

喜夏-厌秋 提交于 2021-02-08 11:21:32

问题


I am new to webpack. I wish to minify all files in a folder to single js using webpack. I don't wish to add all files name manually one by one in entry section.

I am quite sure there must be a clean way for that but I am unable to find that on google or webpack official documentation.

Please help.


回答1:


This might work:

const glob = require("glob");

module.exports = {
    entry: glob.sync("./src/*.js")
};


来源:https://stackoverflow.com/questions/42710170/minify-multiple-javascript-files-with-webpack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!