Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/migrate-v1-to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ If your setup still uses the legacy names, you can update them as follows:
- Environment variables
- `WEBPACK_DEV_SERVER_BASE_PORT` -> `RSPACK_DEV_SERVER_BASE_PORT`
- `WEBPACK_DEV_SERVER_PORT_RETRY` -> `RSPACK_DEV_SERVER_PORT_RETRY`
- `WEBPACK_SERVE` -> `RSPACK_SERVE`
- URL query flags
- `webpack-dev-server-hot=false` -> `rspack-dev-server-hot=false`
- `webpack-dev-server-live-reload=false` -> `rspack-dev-server-live-reload=false`
Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export interface Configuration<

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

if (!process.env.WEBPACK_SERVE) {
process.env.WEBPACK_SERVE = 'true';
if (!process.env.RSPACK_SERVE) {
process.env.RSPACK_SERVE = 'true';
}

const getConnect = async () => {
Expand Down
24 changes: 12 additions & 12 deletions tests/e2e/__snapshots__/api.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ exports[`API > Invalidate callback > should use the provided \`callback\` functi

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

exports[`API > RSPACK_SERVE environment variable > should be present > console messages 1`] = `
[
"[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
"[HMR] Waiting for update signal from WDS...",
"Hey.",
]
`;

exports[`API > RSPACK_SERVE environment variable > should be present > page errors 1`] = `[]`;

exports[`API > RSPACK_SERVE environment variable > should be present > response status 1`] = `200`;

exports[`API > Server.checkHostHeader > should allow URLs with scheme for checking origin when the "option.client.webSocketURL" is object > page errors 1`] = `[]`;

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

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

exports[`API > WEBPACK_SERVE environment variable > should be present > console messages 1`] = `
[
"[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
"[HMR] Waiting for update signal from WDS...",
"Hey.",
]
`;

exports[`API > WEBPACK_SERVE environment variable > should be present > page errors 1`] = `[]`;

exports[`API > WEBPACK_SERVE environment variable > should be present > response status 1`] = `200`;

exports[`API > latest async API > should work and allow to rerun dev server multiple times > console messages 1`] = `
[
"[rspack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.",
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const sessionSubscribe = require('../helpers/session-subscribe');
const port = require('../helpers/ports-map').api;

describe('API', () => {
describe('WEBPACK_SERVE environment variable', () => {
describe('RSPACK_SERVE environment variable', () => {
const OLD_ENV = process.env;
let server;
let page;
Expand Down Expand Up @@ -46,7 +46,7 @@ describe('API', () => {

await server.start();

expect(process.env.WEBPACK_SERVE).toBe('true');
expect(process.env.RSPACK_SERVE).toBe('true');

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