Skip to content

gunta/webpack-dev-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 webpack's options, 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)

Like webpack, but you omit the output filename.

Additional options:

--port <number> Change the port (default: 8080)

--content-base Serve HTML content from this directory or URL (default: current directory)

--noinfo Less console output

--quiet No console output

Usage (javascript)

var Server = require("webpack-dev-server");
var options = {
	contentBase: __dirname + "/directory",
	// A directory, file or URL
	// It will be served as content

	hot: true,
	// Enable special support for Hot Module Replacement
	// Page is no longer updated, but a "webpackHotUpdate" message is send to the content

	// ...
	// webpack-dev-middleware options
	// you can use all options of the middleware
};
new Server(webpack(/*... webpack options ...*/), options).listen(port[, host]);

Contributing

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

Lisence

Copyright 2012-2013 Tobias Koppers

MIT

About

Serves a webpack app. Updates the browser on changes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published