rspack

How to use Unix soket for Rspack Dev Server?


I am trying a complex project configuration where Rspack is being used. The Dev Server will run behind the proxy and thus need to use Unix-like socket as opposed to default TCP port.

I have been already using Webpack DevServer with Unix sockets using devServer.ipc field. How can I do the same using Rspack dev server? I am not able to find any documentation for similar functionality.

Note: It is also okay if I need to manage it via programmatic API.


Solution

  • rspack-dev-server uses webpack-dev-server internally and proxies devServer.ipc to it...

    Link to doc in repo

    import { Configuration } from '@rspack/cli';
    const config: Configuration = {
      // ...
      devServer: {
            ipc: true,
            //ipc: '/tmp/socket_name.sock',
      },
    };
    export default config;