Webpack: Emphasise need for --config if no webpack.config.js (e.g. webpack-merge) #26552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because
A recent problem a fellow learner was facing was the result of using webpack-merge (which is mentioned in step 4 of the webpack lesson. Whilst the assignment tutorial does show using the
--config
option to specify a command use a particular webpack config file, it does not explain what happens if you omit it and that no specified file will cause webpack to search for some default files (includingwebpack.config.js
, which is what the previous tutorials show using).The above learner's watch command was likely taken from a previous tutorial showing it, where it simply showed
webpack --watch
since the tutorial was using awebpack.config.js
file and thus did not need the--config
option. Since they did not include this and they were using files named as per the merge tutorial, they encountered an error.This PR adds a little step 4.1 just emphasising that if someone did use
webpack-merge
and/or didn't have awebpack-config.js
file, then they'd need to use the--config
option to specify which config file a command should run. This should hopefully reduce the chance of such an error reoccurring, as the webpack docs do not clearly highlight this from the linked tutorials.This PR
--config
if no file namedwebpack.config.js
Issue
N/A
Additional Information
Pull Request Requirements
location of change: brief description of change
format, e.g.Intro to HTML and CSS lesson: Fix link text
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section