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

Webpack: Emphasise need for --config if no webpack.config.js (e.g. webpack-merge) #26552

Conversation

MaoShizhong
Copy link
Contributor

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 (including webpack.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 a webpack.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 a webpack-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

  • Add step 4.1 emphasising --config if no file named webpack.config.js

Issue

N/A

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added the Content: JavaScript Involves the JavaScript course label Oct 23, 2023
@KevinMulhern KevinMulhern requested review from a team and 01zulfi and removed request for a team October 24, 2023 08:18
Copy link
Member

@01zulfi 01zulfi left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

@01zulfi 01zulfi merged commit 7f4b50e into TheOdinProject:main Nov 4, 2023
2 checks passed
@MaoShizhong MaoShizhong deleted the chore/mention-specify-config-file-if-using-webpack-merge branch November 4, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: JavaScript Involves the JavaScript course
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants