JSPM

  • Created
  • Published
  • Downloads 14503502
  • Score
    100M100P100Q226873F
  • License MIT

Serves a webpack app. Updates the browser on changes.

Package Exports

  • webpack-dev-server
  • webpack-dev-server/bin/webpack-dev-server
  • webpack-dev-server/bin/webpack-dev-server.js
  • webpack-dev-server/client/live.html
  • webpack-dev-server/lib/Server
  • webpack-dev-server/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webpack-dev-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

webpack-dev-server

THIS SERVER SHOULD ONLY USED FOR DEVELOPMENT!

DO NOT USE IT IN PRODUCTION!

What is it?

It's a little server using webpack-dev-middleware to serve a webpack app.

It also uses socket.io to update the browser if the bundle has changed (and to display compilation errors).

You need to pass a web app entry point, and you can also pass a html page to display and webpack options.

Inspiration

This project is heavily inspirated by peerigon/nof5.

Usage (command line)

webpack-dev-server <webpack entry point>

Options:
  --content-page  A html page to load  [string]
  --content-url   A url to load        [string]
  --options       webpack options      [string]
  --port          The port             [number]

Usage (javascript)

var Server = require("webpack-dev-server");
var options = {
    content: absoluteFilenameToContentHtmlPage, // it will default to a simple page
    contentUrl: "http://...", // it will default to undefined
    webpack: {
        // webpack options
        // ...
        watch: true // recommended

        /* defaults:
        output: "bundle.js",
        debug: true,
        filenames: true,
        watch: true
        */
    }
};
new Server(entryPoint, options).listen(port[, host]);

entryPoint should be an absolute path. It may be prefixed with loaders.

Contributing

The client scripts are build with npm run-script postinstall.

Lisence

Copyright 2012 Tobias Koppers

MIT