-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[DOCS] webpack documentation concept and config section from CommonJS to ESM #7731
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
base: main
Are you sure you want to change the base?
[DOCS] webpack documentation concept and config section from CommonJS to ESM #7731
Conversation
|
@payelcs2024ipcw-source is attempting to deploy a commit to the OpenJS Foundation Team on Vercel. A member of the Team first needs to authorize it. |
evenstensberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! I left a few comments that needs to be adressed. ☀️
| entry: './foo.js', | ||
| output: { | ||
| path: path.resolve(__dirname, 'dist'), | ||
| path: path.resolve(process.cwd(), 'dist'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont use process.cwd, use this
|
Completed the assigned edits in the concept section and proceeded with further improvements in the config section. |
| const pluginName = 'ConsoleLogOnBuildWebpackPlugin'; | ||
|
|
||
| class ConsoleLogOnBuildWebpackPlugin { | ||
| export default class ConsoleLogOnBuildWebpackPlugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected the typo error
| You may have noticed that few webpack configurations look exactly alike. This is because **webpack's configuration file is a JavaScript file that exports a webpack [configuration](/configuration/).** This configuration is then processed by webpack based upon its defined properties. | ||
|
|
||
| Because it's a standard Node.js CommonJS module, you **can do the following**: | ||
| Because it's a standard ECMAscript Module, you **can do the following**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the S in script should be capitalized
|
|
||
| ```javascript | ||
| module.exports = { | ||
| export defualt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong code
|
|
||
| ```javascript | ||
| module.exports = { | ||
| export deafult { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong code
|
|
||
| ```javascript | ||
| module.exports = { | ||
| export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies for the oversight earlier. I've double-checked and fixed the typo now. Please let me know if there r further any issues. Thank you.
Fixes #7636
This pull request updates the Concepts and Config section of the webpack documentation to reflect the transition from CommonJS to ECMAScript Modules (ESM).
Changes made:
module.exportsexamples withexport default.require(...)usage toimport ... from .....import.meta.urlfor resolving paths instead of__dirname).