This is a practical implementation on webpack bundle called sixpack. if you're new to javascript and coding and don't know what webpack is you can take a look at this masterpiece
Clone this repository using following command
git clone https://github.com/omraval18/sixpack.git
Install all the dependencies
npm install
Finally call following command to run the code
node src/index.js
You can go to the src/index.js there you'll see following code at the end
const graph = createGraph("./test/entry.js");
const result = bundle(graph);
console.log(result);
here change the route in createGraph() to your file's location.