Skip to content

docs(getting-started): fix webpack.config.js example for ESM on moder…#7736

Closed
jikrana-del wants to merge 2 commits intowebpack:mainfrom
jikrana-del:main
Closed

docs(getting-started): fix webpack.config.js example for ESM on moder…#7736
jikrana-del wants to merge 2 commits intowebpack:mainfrom
jikrana-del:main

Conversation

@jikrana-del
Copy link
Copy Markdown

Summary

The webpack.config.js example in the Getting Started guide does not work on modern Node.js versions when using ES modules.

This PR updates the example to correctly handle __dirname using import.meta.url and fileURLToPath, so users following the guide do not encounter runtime errors.

What this PR changes

  • Fixes the webpack.config.js example to be compatible with ESM
  • Replaces CommonJS-style __dirname usage with the recommended ESM approach
  • Updates documentation only (no code or API changes)

Type of change

  • Documentation fix

Breaking changes

  • None

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 4, 2026

Someone is attempting to deploy a commit to the OpenJS Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jan 4, 2026

CLA Missing ID


```javascript
import path from 'path';
import { fileURLToPath } from 'url';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this makes the config duplicate, sorry but this change is not needed. Feel free to remove the first export and keep the __dirname logic.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the clarification!
I’ve removed the first export and kept the __dirname logic only.

@jikrana-del
Copy link
Copy Markdown
Author

Thanks for the clarification!
I’ve removed the first export and kept the __dirname logic only.

1 similar comment
@jikrana-del
Copy link
Copy Markdown
Author

Thanks for the clarification!
I’ve removed the first export and kept the __dirname logic only.

@evenstensberg
Copy link
Copy Markdown
Member

Could you sign the CLA?

@alexander-akait
Copy link
Copy Markdown
Member

It was fixed a long time ago

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.

4 participants