0

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.

2
  • 1
    Do those files import each other? Commented Mar 10, 2017 at 20:28
  • Those are plain old javascript files. Have references of common functions but not exactly ES6 import statements with a common starting script. Commented Mar 14, 2017 at 6:32

1 Answer 1

1

This might work:

const glob = require("glob");

module.exports = {
    entry: glob.sync("./src/*.js")
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.