feat: add --serverHost CLI option for configurable dev server hostname #1337
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This pull request adds a new
--serverHostCLI option to thestencil startcommand that allows developers to specify a custom hostname for the development server. The feature also supports configuration via theSTENCIL_SERVER_HOSTenvironment variable. This enhancement maintains full backward compatibility by defaulting tolocalhostwhen no custom host is specified.The implementation propagates the serverHost configuration through the entire application stack:
This change is particularly valuable for Docker-based development environments where binding to
0.0.0.0or a specific hostname is required for proper container networking, while preserving the existing localhost behavior for traditional development setups.Tickets / Documentation
README.md#running-in-dockerprovides some steps on how to run stencil in docker, I've tried following those on both WSL and Linux with no success because of the lack of this feature, after patching it with this feature it worked(perhaps I was missing something and if that is the case I would really like to know)Screenshots (if appropriate)
N/A - This is a CLI configuration enhancement without visual changes.
cc @bigcommerce/storefront-team