You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webpack devserver runs on port 8080 by default. Multiple projects can be run simultaneously by using npm config to assign different ports the the project's package.jsonname. For example, three projects named csr-site, pro-bono and ar-project could be run simultaneously on custom ports, after running these commands:
npm config set csr-site:port 8080
npm config set pro-bono:port 8081
npm config set ar-project:port 8082
Could this be an argument to the tools invocation? npm run start would default to port 8080, npm run start 8081 would run on port 8081. Is it possible to pass a command line arg into an npm script? Difficult? The start script is just a wrapper for an ugly docker compose command.
Yes! Going with npm run start --port=8531 which would set the environment variable $npm_config_port to 8531. The docker compose files recognize this variable and pass it through.
Invocation scripts now call docker compose with --service-ports. This lets us define ports in docker-compose.json and to keep the package.json scripts a little cleaner.
https://github.com/ideasonpurpose/docker-wordpress-dev/blob/master/README.md#alternate-devserver-ports
This broke in npm v7, based on RFC 21
See also:
The text was updated successfully, but these errors were encountered: