Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add port option to stencil start #1250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

onur-o7
Copy link

@onur-o7 onur-o7 commented Jan 2, 2025

What?

Adds port option to stencil start.

Why?

Our company manages multiple dev servers that each run on a unique port using config.stencil.port. It has become challenging to work efficiently on localhost as we need to track different ports. This way, when closing a tab or browser, we won't have to copy the URL or restart the dev server with stencil start -o again.

cc @bigcommerce/storefront-team

if (cliOptions.port) {
initialStencilConfig.port = cliOptions.port;
}

// Use initial (before updates) port for BrowserSync
const browserSyncPort = initialStencilConfig.port;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do instead

Suggested change
const browserSyncPort = initialStencilConfig.port;
const browserSyncPort = cliOptions.port || initialStencilConfig.port;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then we need do change

const updatedStencilConfig = this.updateStencilConfig(
            { initialStencilConfig, port: browserSyncPort},
            storeInfoFromAPI,
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants