What is the difference between export HTTPS=true and set HTTPS=true (react)?

Viewed 493

package.json

"scripts": {

"start": "export HTTPS=true&&PORT=3000 react-scripts start"

vs

"start": "set HTTPS=true&&PORT=3000 react-scripts start"

}

1 Answers

export: Used to set an environment variable in bash (Linux/Mac).

set: Used to set an environment variable for CMD (Windows).

If you want to support both of the environments, you can use cross-env and refactor your package.json as following:

"start": "cross-env HTTPS=true PORT=3000 react-scripts start"

(don't forget to install cross-env in the project dev dependencies)

Related