Thank you for the article.
From the last sentence in point 9, you said 'The webpack-dev-server took everything from the src folder and outputted it to our browser.'
However I do not understand how is webpack-dev-server able to do that since the src/index.html does not link index.js.
Hi 👋, I'm Anubhav SarkarI am a full-stack developer based out of Mumbai, IN. I am currently focused on full-stack development using .NET with C# and React with TypeScript.
So, what webpack-dev-server does is, it just shows whatever files are needed to be displayed on the browser. If you check the devServer attribute in the config file, you will see that I mentioned it to take all files from the ‘src’ folder and display them on the browser. However the part which you are looking for, is done by the html-webpack-plugin. This is another npm package, which takes the output js file, i.e, the single/ final prod build file and then calls it in the index.html file.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you for the article.
From the last sentence in point 9, you said 'The webpack-dev-server took everything from the src folder and outputted it to our browser.'
However I do not understand how is webpack-dev-server able to do that since the src/index.html does not link index.js.
Thanks for your feedback. 😄
So, what webpack-dev-server does is, it just shows whatever files are needed to be displayed on the browser. If you check the devServer attribute in the config file, you will see that I mentioned it to take all files from the ‘src’ folder and display them on the browser. However the part which you are looking for, is done by the html-webpack-plugin. This is another npm package, which takes the output js file, i.e, the single/ final prod build file and then calls it in the index.html file.