The nx/rspack withNx method does not pick the custom port option that comes from the project.json or the CLI args and instead just uses a hardcoded value of 4200 when the serve command is being executed.
nx run crm-root:serve
You are depending on apply entry lazily, this behavior has been deprecated, you can setup 'experiments.rspackFuture.disableApplyEntryLazily = true' to disable this behavior, and this will be enabled by default in v0.5
Set env `RSPACK_DEP_WARNINGS` to 'false' to temporarily disable deprecation warnings.
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:4200/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.114.2:4200/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:4200/
<i> [webpack-dev-server] Content not from webpack is served from '<my_project_path>/public' directory
...
nx run crm-root:serve --port=4444
You are depending on apply entry lazily, this behavior has been deprecated, you can setup 'experiments.rspackFuture.disableApplyEntryLazily = true' to disable this behavior, and this will be enabled by default in v0.5
Set env `RSPACK_DEP_WARNINGS` to 'false' to temporarily disable deprecation warnings.
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:4200/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.114.2:4200/
<i> [webpack-dev-server] On Your Network (IPv6): http://[fe80::1]:4200/
<i> [webpack-dev-server] Content not from webpack is served from '<my_project_path>/public' directory
How To Reproduce
Create a simple react app with rspack using nx/react and nx/rspack plugins
Try passing a custom port value and serving the app from nx CLI
The Problem
The nx/rspack
withNx
method does not pick the customport
option that comes from theproject.json
or the CLI args and instead just uses a hardcoded value of4200
when theserve
command is being executed.Problem Reference
https://github.com/nrwl/nx-labs/blob/1d20a14c1cf58c5136ccf35437ae43a0a093cf0b/packages/rspack/src/utils/with-nx.ts#L128
Problem Example
nx deps:
project configs:
outputs:
How To Reproduce