Skip to content

Commit e52813f

Browse files
authored
fix: replace WEBPACK_SERVE with RSPACK_SERVE (#174)
1 parent 99a1f1c commit e52813f

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

docs/migrate-v1-to-v2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ If your setup still uses the legacy names, you can update them as follows:
255255
- Environment variables
256256
- `WEBPACK_DEV_SERVER_BASE_PORT` -> `RSPACK_DEV_SERVER_BASE_PORT`
257257
- `WEBPACK_DEV_SERVER_PORT_RETRY` -> `RSPACK_DEV_SERVER_PORT_RETRY`
258+
- `WEBPACK_SERVE` -> `RSPACK_SERVE`
258259
- URL query flags
259260
- `webpack-dev-server-hot=false` -> `rspack-dev-server-hot=false`
260261
- `webpack-dev-server-live-reload=false` -> `rspack-dev-server-live-reload=false`

src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ export interface Configuration<
125125

126126
// Define BasicApplication and Server as ambient, or import them
127127

128-
if (!process.env.WEBPACK_SERVE) {
129-
process.env.WEBPACK_SERVE = 'true';
128+
if (!process.env.RSPACK_SERVE) {
129+
process.env.RSPACK_SERVE = 'true';
130130
}
131131

132132
const getConnect = async () => {

tests/e2e/__snapshots__/api.test.js.snap

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ exports[`API > Invalidate callback > should use the provided \`callback\` functi
2424

2525
exports[`API > Invalidate callback > should use the provided \`callback\` function > response status 1`] = `200`;
2626

27+
exports[`API > RSPACK_SERVE environment variable > should be present > console messages 1`] = `
28+
[
29+
"[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
30+
"[HMR] Waiting for update signal from WDS...",
31+
"Hey.",
32+
]
33+
`;
34+
35+
exports[`API > RSPACK_SERVE environment variable > should be present > page errors 1`] = `[]`;
36+
37+
exports[`API > RSPACK_SERVE environment variable > should be present > response status 1`] = `200`;
38+
2739
exports[`API > Server.checkHostHeader > should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object > page errors 1`] = `[]`;
2840

2941
exports[`API > Server.checkHostHeader > should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object > response status 1`] = `200`;
@@ -92,18 +104,6 @@ exports[`API > Server.getFreePort > should return the port when the port is unde
92104

93105
exports[`API > Server.getFreePort > should throw the error when the port isn't found 1`] = `[Error: No available ports found]`;
94106

95-
exports[`API > WEBPACK_SERVE environment variable > should be present > console messages 1`] = `
96-
[
97-
"[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
98-
"[HMR] Waiting for update signal from WDS...",
99-
"Hey.",
100-
]
101-
`;
102-
103-
exports[`API > WEBPACK_SERVE environment variable > should be present > page errors 1`] = `[]`;
104-
105-
exports[`API > WEBPACK_SERVE environment variable > should be present > response status 1`] = `200`;
106-
107107
exports[`API > latest async API > should work and allow to rerun dev server multiple times > console messages 1`] = `
108108
[
109109
"[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",

tests/e2e/api.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const sessionSubscribe = require('../helpers/session-subscribe');
77
const port = require('../helpers/ports-map').api;
88

99
describe('API', () => {
10-
describe('WEBPACK_SERVE environment variable', () => {
10+
describe('RSPACK_SERVE environment variable', () => {
1111
const OLD_ENV = process.env;
1212
let server;
1313
let page;
@@ -46,7 +46,7 @@ describe('API', () => {
4646

4747
await server.start();
4848

49-
expect(process.env.WEBPACK_SERVE).toBe('true');
49+
expect(process.env.RSPACK_SERVE).toBe('true');
5050

5151
const response = await page.goto(`http://127.0.0.1:${port}/`, {
5252
waitUntil: 'networkidle0',

0 commit comments

Comments
 (0)