Categories
JavaScript Answers

How to add wildcard mapping in entry of Node Webpack?

Spread the love

To add wildcard mapping in entry of Node Webpack, we use glob.

For instance, we write

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

to set entry to the pattern returned by glob.sync to add all the paths that match the pattern as entry points.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published.