Skip to content

replace 'bundle.js' with 'main.js' in examples #2136

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

Merged
merged 5 commits into from
Jun 14, 2018
Merged

replace 'bundle.js' with 'main.js' in examples #2136

merged 5 commits into from
Jun 14, 2018

Conversation

royair
Copy link
Contributor

@royair royair commented May 10, 2018

'npx webpack' default output file 'main.js',
while in examples 'bundle.js' is being used.

corrected examples accordingly.

'npx webpack' default output file is no longer bundle.js but rather main.js.
corrected accordingly.
@montogeek
Copy link
Member

@EugeneHlushko I don't understand this change.

@EugeneHlushko
Copy link
Member

EugeneHlushko commented May 10, 2018

wasnt this already collected and merged?

We changed to the opposite

@EugeneHlushko
Copy link
Member

EugeneHlushko commented May 10, 2018

i think i found the root cause of this one @montogeek

As soon as you have webpack.config.js file in the directory where you run npx webpack, even without explicitly specifying --config webpack.config.js, the config is being used by webpack.

This is how we got different results while testing this behaviour by running the exact same command npx webpack. Which, if a user follows the guide from scratch, makes this pr completely valid.

Maybe it makes sense to remove the --config webpack.js.config from the guide completely if thats being picked up by default to reduce the level of confusion and explicitly note that webpack by default picks that filename as config if it exists in FS if none had been specified ?

@royair
Copy link
Contributor Author

royair commented May 11, 2018

@EugeneHlushko i got 'main.js' as output file even without having a webpack.config.js file.
(this can be easily tested and verified)
btw, i'm using a windows OS, if that makes any different.

@EugeneHlushko
Copy link
Member

EugeneHlushko commented May 11, 2018

Exactly, thats what i'm also trying to say. Without config you get main.js. But then as soon as you get a config (file in root dir) named webpack.config.js regardless of pointing webpack onto it using --config %path% it gets picked up, thats how we previously made this mistake by substituting main.js into bundle.js for configless run.

Copy link
Member

@EugeneHlushko EugeneHlushko left a comment

Choose a reason for hiding this comment

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

sorry forgot to approve

@montogeek montogeek merged commit 48db7c3 into webpack:master Jun 14, 2018
@montogeek
Copy link
Member

Thanks

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.

4 participants