Hi Noders,
I have just started off with my first app in Vue.js and also had to use Webpack for the first time.
All I could understand is that Webpack bundles the (multiple) scripts into a specified folder which I can refer in my index.html in my app's root floor.
npm run dev starts listening on 8080 (Honestly I didnt know Webpack has a webserver ^_^ Cool...)
Now that I have a Webpack webserver ,
npm run build)?Thanks!
An Excellent article I found what gave an clear understanding of Webpack from ground-up.
Mike Conrad
Hacker and Entrepreneur
Here is my understanding :
The Webpack dev server starts a small Express server for you which serves all the static assets. So, you don't have to configure anything extra to serve those
home.html,page1.htmlfiles. Just put them in root and it should work.To run the server on a different port do this : webpack-dev-server --host 0.0.0.0 --port 8000
Webpack supports hot module replacement and hot reloading. I guess if you run the dev server with
--hotflag it'll watch for file changes and do a hot reload. e.g.webpack-dev-server --port 8000 --hot.I don't understand the 4th point. Can you elaborate and explain what exactly you are trying to do here?
Hope this helps.