Skip to main content

DevServer

craco.config.js
module.exports = {
// ...
devServer: { /* ... */ },
devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => {
/* ... */
return devServerConfig;
},
};
tip

Properties listed twice in the outline above (for example, devServer) can be assigned an object literal or a function. See configuration tips for details.

devServer

DevServerConfig or (config: DevServerConfig, { env, paths, proxy, allowedHost }) => DevServerConfig

Any DevServer configuration options: https://webpack.js.org/configuration/dev-server/#devserver

The function version of configure provides two extra properties within the context object:

  • proxy - DevServer proxy config array
  • allowedHost - the allowed host