Skip to content

Conversation

@payelcs2024ipcw-source
Copy link

@payelcs2024ipcw-source payelcs2024ipcw-source commented Dec 21, 2025

Fixes #7636

This pull request updates the Concepts section of the webpack documentation to reflect the transition from CommonJS to ECMAScript Modules (ESM).

Changes made:

  • Replaced module.exports examples with export default.
  • Updated require(...) usage to import ... from .....
  • Adjusted wording in the concept explanation to clarify that webpack config files are now standard ECMAScript modules rather than CommonJS modules.
  • Added notes on ESM-specific considerations (e.g., import.meta.url for resolving paths instead of __dirname).

@vercel
Copy link

vercel bot commented Dec 21, 2025

@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.

Copy link
Member

@evenstensberg evenstensberg left a 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'),
Copy link
Member

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

https://stackoverflow.com/a/50052194

entry: './path/to/my/entry/file.js',
output: {
path: path.resolve(__dirname, 'dist'),
path: path.resolve(process.cwd(), 'dist'),
Copy link
Member

Choose a reason for hiding this comment

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

,--,

new webpack.ProgressPlugin().apply(compiler);

compiler.run(function (err, stats) {
compiler.run((err, stats) {
Copy link
Member

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

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.

Feature Request: Update documentation examples to ES6

2 participants