Skip to content

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

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.

2 participants