Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ $ rspack serve -c ./your.config.js
While starting the development server, you can specify the configuration by the `devServer` field of your Rspack config file:

```js
// rspack.config.js
module.exports = {
// rspack.config.mjs
export default {
// ...
devServer: {
// the configuration of the development server
port: 8080
port: 8080,
},
};
```
Expand All @@ -92,19 +92,19 @@ While it's recommended to run `@rspack/dev-server` via the CLI, you may also cho
```js
import { RspackDevServer } from "@rspack/dev-server";
import rspack from "@rspack/core";
import rspackConfig from './rspack.config.js';
import rspackConfig from "./rspack.config.mjs";

const compiler = rspack(rspackConfig);
const devServerOptions = {
...rspackConfig.devServer,
// override
port: 8888
port: 8888,
};

const server = new RspackDevServer(devServerOptions, compiler);

server.startCallback(() => {
console.log('Successfully started server on http://localhost:8888');
console.log("Successfully started server on http://localhost:8888");
});
```

Expand Down
Loading