Each example showcases a particular feature of webpack-dev-server. You can use
these examples to learn how to use certain features, or as a means to test features
when working on a Pull Request.
An example should be as minimal as possible and consists of at least:
- An
app.jsfile - the entry point for an example app. - A
README.mdfile containing information about, and how to run the example app. - A description of what should happen when running the example.
- A
webpack.config.jsfile containing thewebpackconfiguration for the example app.
API examples can be found in the api directory. These examples demonstrate how
to access and run webpack-dev-server directly in your application / script.
CLI examples can be found in the cli directory. These examples demonstrate how
to run webpack-dev-server from the command line in your console / terminal.
- Each example's
webpackconfig is wrapped withutil.setup; a helper function that adds plugins and configuration needed by each example to render in a consistent and visually pleasing way. - Examples'
bundle.jsandindex.htmlfiles are compiled and served from memory. You won't actually see these files written to disk, but if you examine thewebpackoutput, you should see their file indicators.