Coder Social home page Coder Social logo

build-tools-bucheli-course-viewing-our-app-with-webpack-dev-server's Introduction

BUILD-TOOLS-BUCHELI-COURSE-VIEWING-OUR-APP-WITH-WEBPACK-DEV-SERVER

In order to view the app in the browser follow the next steps:

  • We would first install webpack-dev-server as a development dependency in a local environment:
npm install --save-dev webpack-dev-server
  • Next, we need an HTML document, and it should embed the JavaScript from our exit point:
<script src="./dist/main.js"></script>
  • To use webpack-dev-server, we’ll add start command to package.json inside of the scripts section.
"build": "webpack --watch",
"start": "webpack serve"
  • This is building our project and then serving it to the browser.

The build command is going to compile our project as well as update it when we make changes.

The serve command is going to serve our build and refresh when the build changes.

In order to have our project update any time we make changes, we would typically run each of these commands in a separate terminal.

We would first run the build command in one terminal, to create the bundle and wait for updates.

npm run build

We would next launch a second terminal and run the start command to serve the site.

npm run start

build-tools-bucheli-course-viewing-our-app-with-webpack-dev-server's People

Contributors

arbucheli avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.