问题
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