How to merge two js files into one using webpack?

Viewed 59

So my problem is I have 3 files ...that is

  1. throttle js file---having the function for throttling
  2. debounce js file---having the function for debouncing

now I need to export both these files into an index.js

and after using webpack to transpile the files..I should have a main file that has these two libraries and should be publoshed as a local package. This main file should be used in a later project and only the functions should be there in the main file.

I have created three js files in the src folder and created a dist folder. but when I do npx webpack...the main.js is empty. I dont know why. Can anyone please tell me how to go about this?

0 Answers
Related