-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[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
src/content/concepts/index.mdx
Outdated
| entry: './path/to/my/entry/file.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.
,--,
src/content/concepts/plugins.mdx
Outdated
| new webpack.ProgressPlugin().apply(compiler); | ||
|
|
||
| compiler.run(function (err, stats) { | ||
| compiler.run((err, stats) { |
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.
keep the function syntax its easier to learn and read
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.
Sure, I'll keep it easy to read. Thank you reviewing
|
Completed the assigned edits in the concept section and proceeded with further improvements in the config section. |
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).