Giter VIP home page Giter VIP logo

webpack-dev-server's Introduction

webpack-dev-server

npm deps test

Use webpack with a development server that provides live reloading. This should be used for development only.

It uses webpack-dev-middleware under the hood, which provides fast in-memory access to the webpack assets.

Installation

npm install webpack-dev-server --save-dev

Getting started

The easiest way to use it is with the CLI. In the directory where your webpack.config.js is, run:

node_modules/.bin/webpack-dev-server

This will start a server, listening on connections from localhost on port 8080.

Now, when you change something in your assets, it should live-reload the files.

See the documentation for more use cases and options.

Inspiration

This project is heavily inspired by peerigon/nof5.

Contributing

The client scripts are built with npm run-script prepublish.

Run the relevant examples to see if all functionality still works. When introducing new functionality, also add an example. This helps the maintainers to understand it and check if it still works.

When making a PR, keep these goals in mind:

  • The communication library (SockJS) should not be exposed to the user.
  • A user should not try to implement stuff that accesses the webpack filesystem, because this lead to bugs (the middleware does it while blocking requests until the compilation has finished, the blocking is important).
  • It should be a development only tool (compiling in production is bad, one should precompile and deliver the compiled assets).
  • There are hooks to add your own features, so we should not add less-common features.
  • Processing options and stats display is delegated to webpack, so webpack-dev-server/middleware should not do much with it. This also helps us to keep up-to-date with webpack updates.
  • The workflow should be to start webpack-dev-server as a separate process, next to the "normal" server and to request the script from this server or to proxy from dev-server to "normal" server (because webpack blocks the event queue too much while compiling which can affect "normal" server).

License

Copyright 2012-2016 Tobias Koppers

MIT

webpack-dev-server's People

Contributors

sokra avatar spacek33z avatar jhnns avatar simenb avatar stutrek avatar arnihermann avatar mrsharpoblunto avatar svsool avatar aves84 avatar zeen avatar troutowicz avatar elliottsj avatar jamsesso avatar mjackson avatar matthiaswinkelmann avatar crohde7707 avatar watsoncj avatar everett1992 avatar chentsulin avatar ruudk avatar phillipj avatar perry-mitchell avatar pcorpet avatar oskarer avatar nkbt avatar nicholasboll avatar ntharim avatar nathanstaines avatar mrorz avatar meltuhamy avatar

Watchers

Andrew Kidoo avatar  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.