File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,12 @@ $ rspack serve -c ./your.config.js
73
73
While starting the development server, you can specify the configuration by the ` devServer ` field of your Rspack config file:
74
74
75
75
``` js
76
- // rspack.config.js
77
- module . exports = {
76
+ // rspack.config.mjs
77
+ export default {
78
78
// ...
79
79
devServer: {
80
80
// the configuration of the development server
81
- port: 8080
81
+ port: 8080 ,
82
82
},
83
83
};
84
84
```
@@ -92,19 +92,19 @@ While it's recommended to run `@rspack/dev-server` via the CLI, you may also cho
92
92
``` js
93
93
import { RspackDevServer } from " @rspack/dev-server" ;
94
94
import rspack from " @rspack/core" ;
95
- import rspackConfig from ' ./rspack.config.js ' ;
95
+ import rspackConfig from " ./rspack.config.mjs " ;
96
96
97
97
const compiler = rspack (rspackConfig);
98
98
const devServerOptions = {
99
99
... rspackConfig .devServer ,
100
100
// override
101
- port: 8888
101
+ port: 8888 ,
102
102
};
103
103
104
104
const server = new RspackDevServer (devServerOptions, compiler);
105
105
106
106
server .startCallback (() => {
107
- console .log (' Successfully started server on http://localhost:8888' );
107
+ console .log (" Successfully started server on http://localhost:8888" );
108
108
});
109
109
```
110
110
You can’t perform that action at this time.
0 commit comments