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

bugfix - sets the default entry point if not provided #268

Closed
wants to merge 2 commits into from

Conversation

ryanclark
Copy link
Member

@ryanclark ryanclark commented Feb 16, 2018

What kind of change does this PR introduce?
Sets the default entry point to ./src if it isn't provided in the webpack config (or if no config is provided at all).

Did you add tests for your changes?
No, there's no test coverage of convert-argv.js

If relevant, did you update the documentation?
No, as this is covered by the normal webpack documentation.

Summary
When trying to run webpack-dev-server with no config file or no entry set, it did not default to ./src like the webpack compiler does.

It solves this issue - webpack/webpack-dev-server#1308

Does this PR introduce a breaking change?
No

@webpack-bot
Copy link

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

@@ -95,6 +95,14 @@ exports[`entry transforms correctly using "entry-0" data 12`] = `
"
`;

exports[`entry transforms correctly using "entry-0" data 13`] = `
"module.exports = {
entry: module.exports = {}
Copy link
Member

Choose a reason for hiding this comment

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

? 🙃

Copy link
Member

Choose a reason for hiding this comment

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

Yup ideally an empty object should work no?

Copy link
Member

Choose a reason for hiding this comment

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

Correction: an empty config object

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'm testing the wrong thing - this is the yeoman transformation test snapshot.

@TheLarkInn
Copy link
Member

Codacy looks to be a flake when I look at it, Ship it.gif

Copy link
Member

@TheLarkInn TheLarkInn left a comment

Choose a reason for hiding this comment

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

Instead of setting a default here, which webpack/webpack@WebpackOptionsDefaulter.js

Let's instead just remove the check that validates the existence of options.entry entirely. So tl;dr webpack-cli doesn't warn, or prevent webpack-dev-server from running webpack without an entry provided.

Am I missing something there?

@ryanclark
Copy link
Member Author

Turns out the issue lies with the webpack-dev-server - see this comment.

Closing this PR.

@ryanclark ryanclark closed this Feb 17, 2018
@ryanclark ryanclark deleted the bugfix/default-entry branch February 17, 2018 00:13
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.

4 participants