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

fix: Ensure devServer info message uses actual devServer config #1770

Merged
merged 2 commits into from
Jan 7, 2023

Conversation

rschristian
Copy link
Member

What kind of change does this PR introduce?

Refactor

Did you add tests for your changes?

No

Summary

Essentially, we are normalizing CLI options way too late, causing inconsistencies.

As the output message didn't consume webpack.devServer's config, there were some situations in which the two wouldn't match up: an example of this being HTTPS=true yarn preact watch. We consumed process.env.HTTPS in the informational text, but not for the actual dev server config. The user would see an error if they tried to open the URL we provided in their browser.

Does this PR introduce a breaking change?

Other information

Please paste the results of preact info here.

@rschristian rschristian requested a review from a team as a code owner January 7, 2023 21:30
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2023

🦋 Changeset detected

Latest commit: e8d4182

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -8,7 +8,6 @@ exports.build = async function buildCommand(src, argv) {
argv.src = src || argv.src;
// add `default:true`s, `--no-*` disables
argv.prerender = toBool(argv.prerender);
argv.production = toBool(argv.production);
Copy link
Member Author

Choose a reason for hiding this comment

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

production is not a valid CLI flag, so it's been moved into run-webpack.js with the other derived env values.

@rschristian rschristian merged commit a526a00 into master Jan 7, 2023
@rschristian rschristian deleted the fix/normalize-devserver-opts-earlier branch January 7, 2023 21:40
@preact-bot preact-bot mentioned this pull request Jan 7, 2023
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.

1 participant