
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
@rspack/dev-server
Advanced tools
Use Rspack with a development server that provides live reloading. This should be used for development only.
@rspack/dev-server
is based onwebpack-dev-server@5
First of all, install @rspack/dev-server
and @rspack/core
by your favorite package manager:
# npm
$ npm install @rspack/dev-server @rspack/core --save-dev
# yarn
$ yarn add @rspack/dev-server @rspack/core --dev
# pnpm
$ pnpm add @rspack/dev-server @rspack/core --save-dev
# bun
$ bun add @rspack/dev-server @rspack/core -D
There are two recommended ways to use @rspack/dev-server
:
The easiest way to use it is with the @rspack/cli
.
You can install it in your project by:
# npm
$ npm install @rspack/cli --save-dev
# yarn
$ yarn add @rspack/cli --dev
# pnpm
$ pnpm add @rspack/cli --save-dev
# bun
$ bun add @rspack/cli -D
And then start the development server by:
# with rspack.config.js
$ rspack serve
# with custom config file
$ rspack serve -c ./your.config.js
See CLI for more details.
While starting the development server, you can specify the configuration by the devServer
field of your Rspack config file:
// rspack.config.js
module.exports = {
// ...
devServer: {
// the configuration of the development server
port: 8080
},
};
See DevServer for all configuration options.
While it's recommended to run @rspack/dev-server
via the CLI, you may also choose to start a server via the API.
import { RspackDevServer } from "@rspack/dev-server";
import rspack from "@rspack/core";
import rspackConfig from './rspack.config.js';
const compiler = rspack(rspackConfig);
const devServerOptions = {
...rspackConfig.devServer,
// override
port: 8888
};
const server = new RspackDevServer(devServerOptions, compiler);
server.startCallback(() => {
console.log('Successfully started server on http://localhost:8888');
});
Cause
@rspack/dev-server
is based onwebpack-dev-server@5
, you can see the webpack-dev-server API for more methods of the server instance.
Thanks to the webpack-dev-server project created by @sokra
FAQs
Development server for rspack
The npm package @rspack/dev-server receives a total of 429,287 weekly downloads. As such, @rspack/dev-server popularity was classified as popular.
We found that @rspack/dev-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.