webpack-dev-server
Serves a webpack app. Updates the browser on changes. Documentation https://webpack.js.org/configuration/dev-server/.
File Explorer
- changelog-generator.mjs
- changeset-validate.mjs
- config.json
- README.md
- dependency-review.yml
- nodejs.yml
- release.yml
- dependabot.yml
- commit-msg
- pre-commit
- webpack-dev-server.js
- WebSocketClient.js
- index.js
- tapable.js
- log.js
- sendMessage.js
- globals.d.ts
- index.js
- overlay.js
- progress.js
- socket.js
- webpack.config.js
- favicon.ico
- geomanist-medium.woff
- geomanist-medium.woff2
- icon-square.svg
- layout.html
- style.css
- app.js
- README.md
- app.js
- README.md
- server.js
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- server.js
- webpack.config.js
- app.js
- README.md
- server.js
- webpack.config.js
- app.js
- README.md
- server.js
- webpack.config.js
- app.js
- README.md
- server.js
- webpack.config.js
- app.js
- README.md
- server.js
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- localhost-cert.pem
- localhost-privkey.pem
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- create-button.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- layout.html
- README.md
- webpack.config.js
- app.js
- index.html
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- pixels.png
- README.md
- style.less
- svg.svg
- webpack.config.js
- app.js
- README.md
- webpack.config.cjs
- app.js
- README.md
- webpack.config.js
- app.js
- pixels.png
- README.md
- style.less
- svg.svg
- webpack.config.js
- app.js
- index.html
- README.md
- webpack.config.js
- app.js
- bypass.html
- README.md
- webpack.config.js
- app.js
- proxy-config.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- client.js
- README.md
- server.js
- webpack.config.js
- README.md
- web.js
- webpack.config.js
- worker.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- file.txt
- README.md
- webpack.config.js
- app.js
- example.js
- README.md
- webpack.config.js
- app.js
- example.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app1.js
- app2.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- ca.pem
- server.crt
- server.key
- server.pfx
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- index.html
- styles.css
- app.js
- README.md
- webpack.config.js
- app.js
- README.md
- webpack.config.js
- README.md
- util.js
- BaseServer.js
- WebsocketServer.js
- getPort.js
- options.json
- Server.js
- babel-plugin-rewrite-relative-dynamic-import.mjs
- check-test-ports.mjs
- extend-webpack-types.js
- finalize-cjs-build.mjs
- node-test-setup.mjs
- run-tests.mjs
- normalize-options.test.js.snap.webpack5
- validate-options.test.js.snap.webpack5
- basic.test.js.snap.webpack5
- bonjour-option.test.js.snap.webpack5
- colors.test.js.snap.webpack5
- historyApiFallback-option.test.js.snap.webpack5
- host-option.test.js.snap.webpack5
- ipc-option.test.js.snap.webpack5
- port-option.test.js.snap.webpack5
- server-option.test.js.snap.webpack5
- static-option.test.js.snap.webpack5
- watchFiles-option.test.js.snap.webpack5
- allowedHosts-option.test.js
- basic.test.js
- bonjour-option.test.js
- client-option.test.js
- colors.test.js
- compress-option.test.js
- historyApiFallback-option.test.js
- host-option.test.js
- hot-option.test.js
- ipc-option.test.js
- liveReload-option.test.js
- open-option.test.js
- port-option.test.js
- server-option.test.js
- static-option.test.js
- watchFiles-option.test.js
- webSocketServer-option.test.js
- index.test.js.snap.webpack5
- socket-helper.test.js.snap.webpack5
- WebsocketClient.test.js.snap.webpack5
- WebsocketClient.test.js
- getCurrentScriptSource.test.js.snap.webpack5
- log.test.js.snap.webpack5
- reloadApp.test.js.snap.webpack5
- sendMessage.test.js.snap.webpack5
- createSocketURL.test.js
- getCurrentScriptSource.test.js
- log.test.js
- sendMessage.test.js
- bundle.test.js
- index.test.js
- ReactErrorBoundary.test.js
- socket-helper.test.js
- allowed-hosts.test.js.snap.webpack5
- api-plugin.test.js.snap.webpack5
- api.test.js.snap.webpack5
- bonjour.test.js.snap.webpack5
- built-in-routes.test.js.snap.webpack5
- client-reconnect.test.js.snap.webpack5
- client.test.js.snap.webpack5
- compress.test.js.snap.webpack5
- entry.test.js.snap.webpack5
- headers.test.js.snap.webpack5
- history-api-fallback.test.js.snap.webpack5
- host.test.js.snap.webpack5
- hot-and-live-reload.test.js.snap.webpack5
- ipc.test.js.snap.webpack5
- logging.test.js.snap.webpack5
- mime-types.test.js.snap.webpack5
- module-federation.test.js.snap.webpack5
- multi-compiler.test.js.snap.webpack5
- on-listening.test.js.snap.webpack5
- overlay.test.js.snap.webpack5
- port.test.js.snap.webpack5
- server-and-client-transport.test.js.snap.webpack5
- server.test.js.snap.webpack5
- setup-exit-signals.test.js.snap.webpack5
- setup-middlewares.test.js.snap.webpack5
- static-directory.test.js.snap.webpack5
- static-public-path.test.js.snap.webpack5
- stats.test.js.snap.webpack5
- target.test.js.snap.webpack5
- watch-files.test.js.snap.webpack5
- web-socket-communication.test.js.snap.webpack5
- web-socket-server-url.test.js.snap.webpack5
- web-socket-server.test.js.snap.webpack5
- allowed-hosts.test.js
- api-plugin.test.js
- api.test.js
- app.test.js
- bonjour.test.js
- built-in-routes.test.js
- client-reconnect.test.js
- client.test.js
- compress.test.js
- cross-origin-request.test.js
- entry.test.js
- headers.test.js
- history-api-fallback.test.js
- host.test.js
- hot-and-live-reload.test.js
- ipc.test.js
- lazy-compilation.test.js
- logging.test.js
- mime-types.test.js
- module-federation.test.js
- multi-compiler.test.js
- on-listening.test.js
- options-middleware.test.js
- overlay.test.js
- port.test.js
- progress.test.js
- range-header.test.js
- server-and-client-transport.test.js
- server.test.js
- setup-exit-signals.test.js
- setup-middlewares.test.js
- static-directory.test.js
- static-public-path.test.js
- stats.test.js
- target.test.js
- watch-files.test.js
- web-socket-communication.test.js
- web-socket-server-url.test.js
- web-socket-server.test.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- webpack.config.js
- foo.js
- webpack.config.js
- bar.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- client.js
- server.js
- webpack.config.js
- foo.txt
- bar.js
- foo.js
- index.html
- webpack.config.js
- CustomClientEntry.js
- CustomClientHotEntry.js
- CustomWebSocketClient.js
- foo.js
- webpack.config.js
- bar.js
- client-custom-path-config.js
- client-default-path-config.js
- foo.js
- foo.js
- webpack.config.js
- bar.html
- foo.js
- other.html
- random-file.txt
- webpack.config.js
- bar.html
- foo.js
- index.html
- webpack.config.js
- bar.html
- foo.js
- index.html
- webpack.config.js
- ca-symlink.pem
- ca.pem
- server-symlink.crt
- server-symlink.key
- server-symlink.pfx
- server.crt
- server.key
- server.pfx
- one.js
- two.js
- webpack.config.js
- entry.js
- webpack.config.js
- file.custom
- foo.js
- webpack.config.js
- entry1.js
- entry2.js
- webpack.config.js
- webpack.multi.config.js
- webpack.object-entry.config.js
- webpack.plugin.js
- foo.js
- webpack.config.js
- one.js
- two.js
- webpack.config.js
- bar.js
- baz.js
- foo.js
- test.html
- webpack.config.js
- foo.js
- trusted-types.webpack.config.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- index.html
- webpack.config.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- webpack.config.simple.js
- foo.js
- webpack.config.js
- foo.js
- webpack.config.js
- localhost-cert.pem
- localhost-privkey.pem
- index.html
- foo.js
- webpack.config.js
- foo.html
- example.txt
- other.txt
- index.html
- .gitkeep
- foo.wasm
- index.html
- other.html
- index.html
- foo.js
- webpack.config.js
- browser.js
- server.js
- webpack.config.js
- foo.html
- example.js
- example.txt
- other.txt
- index.html
- other.html
- index.html
- foo.js
- webpack.config.js
- index.js
- webpack.config.js
- worker.js
- index.js
- webpack.config.js
- worker.js
- compile.js
- conditional-test.js
- custom-http.js
- ExitOnDonePlugin.js
- html-generator-plugin.js
- jsdom-setup.js
- normalize-options.js
- puppeteer-constants.js
- run-browser.js
- session-subscribe.js
- test-bin.js
- test-server.js
- trusted-types-html-generator-plugin.js
- proxy-option.test.js.snap.webpack5
- open-option.test.js
- proxy-option.test.js
- cjs.test.js
- is-web-target.test.js
- normalize-options.test.js
- ports-map.js
- validate-options.test.js
- webpack-dev-server.d.ts
- BaseServer.d.ts
- WebsocketServer.d.ts
- getPort.d.ts
- Server.d.ts
- .cspell.json
- .editorconfig
- .gitattributes
- .gitignore
- .npmrc
- .prettierignore
- .versionrc
- babel.config.js
- CHANGELOG.md
- CODE_OF_CONDUCT.md
- commitlint.config.js
- CONTRIBUTING.md
- DOCUMENTATION-v4.md
- eslint.config.mjs
- LICENSE
- lint-staged.config.js
- migration-v4.md
- migration-v5.md
- migration-v6.md
- package-lock.json
- package.json
- README.md
- tsconfig.client.json
- tsconfig.json
# Installation Guide
node- Node.js >=12.13.0
- npm or yarn or pnpm latest
Setup Steps
npm install
Install project dependencies.
npx webpack serve
Run the development server.
Key Commands
npm install webpack-dev-server --save-dev
Install webpack-dev-server as a dev dependency.
npx webpack serve
Run the webpack dev server with live reloading.
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
npm install
View Details ▼
npm install
Install Node packages.
npm {{[i|install]}}
Install dependencies listed in `package.json`:
npm {{[i|install]}} {{package_name}}@{{version}}
Download a specific version of a package and add it to the list of dependencies in `package.json`:
npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}
Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
npm run
View Details ▼
npm run
Run a script.
npm run
List available scripts:
npm run {{script_name}}
Run a script:
npm run {{script_name}} -- {{argument}} {{--option}}
Pass arguments to a script:
npx
View Details ▼
npx
This command is an alias of `npm exec`.
tldr npm exec
View documentation for the original command:
pnpm
View Details ▼
pnpm
Fast, disk space efficient package manager for Node.js.
Manage Node.js projects and their module dependencies.
pnpm init
Create a `package.json` file:
pnpm {{[i|install]}}
Download all the packages listed as dependencies in `package.json`:
pnpm add {{module_name}}@{{version}}
Download a specific version of a package and add it to the list of dependencies in `package.json`:
webpack
View Details ▼
webpack
Bundle a web project's js files and other assets into a single output file.
webpack {{app.js}} {{bundle.js}}
Create a single output file from an entry point file:
webpack {{app.js}} {{bundle.js}} --module-bind '{{css=css}}'
Load CSS files too from the JavaScript file (this uses the CSS loader for CSS files):
webpack {{[-c|--config]}} {{webpack.config.js}} --progress
Pass a configuration file (with e.g. the entry script and the output filename) and show compilation progress:
yarn
View Details ▼
yarn
JavaScript and Node.js package manager alternative.
yarn global add {{module_name}}
Install a module globally:
yarn install
Install all dependencies referenced in the `package.json` file (the `install` is optional):
yarn add {{module_name}}@{{version}}
Install a module and save it as a dependency to the `package.json` file (add `--dev` to save as a dev dependency):
