Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
webpack-dev-server
Advanced tools
webpack-dev-server is a development server that provides live reloading. It is intended to be used with webpack, a module bundler. It uses webpack's watch mode and, when changes are detected, it recompiles the bundle and notifies the client to reload the page.
Live Reloading
Automatically reloads the page when files are changed. The 'hot' option enables Hot Module Replacement without page refresh as fallback in case of build failures.
module.exports = {
devServer: {
contentBase: './dist',
hot: true
}
};
Custom Middleware
Allows developers to add custom routes before the server starts. Useful for mocking an API or other custom server logic.
module.exports = {
devServer: {
before: function(app, server) {
app.get('/some/path', function(req, res) {
res.json({ custom: 'response' });
});
}
}
};
Proxying API Requests
Redirects API calls to another server. This is useful when you have a separate API backend development server and you want to send API requests on the same domain.
module.exports = {
devServer: {
proxy: {
'/api': 'http://localhost:3000'
}
}
};
HTTPS Support
Allows serving the webpack application over HTTPS. This is useful for testing applications that require secure connections.
module.exports = {
devServer: {
https: true
}
};
BrowserSync is an automation tool that makes web development faster. It synchronizes file changes and interactions across multiple devices. It's similar to webpack-dev-server but works across multiple browsers and devices.
Lite-server is a lightweight development server that serves a web app, opens it in the browser, and refreshes the browser on file changes. It is built on top of BrowserSync and provides fewer configuration options compared to webpack-dev-server.
Serve is a static server that lets you serve static files quickly. It is simpler than webpack-dev-server and does not have built-in support for live reloading or module bundling.
http-server is a simple, zero-configuration command-line HTTP server. It is powerful and has the ability to serve static files, but lacks the advanced features of webpack-dev-server like live reloading and module hot replacement.
THIS SERVER SHOULD BE USED FOR DEVELOPMENT ONLY!
DO NOT USE IT IN PRODUCTION!
It's a live reloading server for webpack.
This project is heavily inspired by peerigon/nof5.
The client scripts are built with npm run-script prepublish
.
Copyright 2012-2014 Tobias Koppers
FAQs
Serves a webpack app. Updates the browser on changes.
The npm package webpack-dev-server receives a total of 11,966,235 weekly downloads. As such, webpack-dev-server popularity was classified as popular.
We found that webpack-dev-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.