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(bin, serve): force default package export, add serve default #815

Merged
merged 2 commits into from Apr 2, 2019
Merged

fix(bin, serve): force default package export, add serve default #815

merged 2 commits into from Apr 2, 2019

Conversation

knagaitsev
Copy link
Contributor

@knagaitsev knagaitsev commented Apr 1, 2019

ISSUES CLOSED: #572

What kind of change does this PR introduce?

This PR introduces a bugfix for the serve package to export a default function, and a more useful error message when a package does not export a default function.

Did you add tests for your changes?

No, I could not seem to find any tests relating to the packages, eg. serve, init. If you would like me to write tests I can, I might just need some guidance.

If relevant, did you update the documentation?

No

Summary

I ran into this issue: #589 while trying webpack-cli serve. The reason for the issue is that serve does not export a default function. There was a PR earlier about this that never got finished #589. serve still has problems, but I think those should be addressed in a separate PR.

Does this PR introduce a breaking change?

The changes in serve are not breaking, but the changes in bin are breaking for serve if you do not consider the changes I made. I'm not exactly sure how the npm publishing process works for these multiple packages. If everything is published at the same time, there is no problem, and if serve is published before the bin, there is no problem. In any case, serve seems to still have other problems with the current webpack-cli version outside of this.

Other information

@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

bin/utils/prompt-command.js Show resolved Hide resolved
packages/serve/index.ts Outdated Show resolved Hide resolved
@evenstensberg
Copy link
Member

@webpack/cli-team PTAL, please do a local test against symlinked packages

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Thank you very much for this important bugfix!

Copy link
Member

@sendilkumarn sendilkumarn left a comment

Choose a reason for hiding this comment

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

👍 A good one 👍

Thanks @Loonride for sending this in

@sendilkumarn sendilkumarn merged commit b96857f into webpack:master Apr 2, 2019
misterdev pushed a commit to misterdev/webpack-cli that referenced this pull request Apr 23, 2019
…pack#815)

* fix(prompt-command, serve): force default package export, add serve default

ISSUES CLOSED: webpack#572

* misc(serve): remove unnecessary exports, update docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: require(...).default is not a function
6 participants