1

I have installed react-app-rewired. In the package.json I have set

"scripts": {
  "start": "react-app-rewired start --scripts-version react-scripts",
}

When I run

npm start

It opens a browser window on localhost:3000 I would like to open it to a specific URL:port that I have set in my hosts file. This will allow my local front end app to contact a remote API without throwing a CORS issue.

1 Answers1

1

this is webpack-dev-server related

module.exports = {
  //...
  devServer: {
    open: ['/my-page'],
  },
};

https://webpack.js.org/configuration/dev-server/#devserveropen

// config-overrides.js

module.exports = () => ({
  devServer: (c) => {
    return () => ({open: ['/newer-url']});
  }
});
test30
  • 3,496
  • 34
  • 26
  • I'm getting ```options.open should be {String|Boolean|Object}``` error with your config-overrides.js example. – Jason Aug 23 '22 at 19:21