docs(getting-started): fix webpack.config.js example for ESM on moder…#7736
Open
jikrana-del wants to merge 2 commits intowebpack:mainfrom
Open
docs(getting-started): fix webpack.config.js example for ESM on moder…#7736jikrana-del wants to merge 2 commits intowebpack:mainfrom
jikrana-del wants to merge 2 commits intowebpack:mainfrom
Conversation
|
Someone is attempting to deploy a commit to the OpenJS Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
|
|
||
| ```javascript | ||
| import path from 'path'; | ||
| import { fileURLToPath } from 'url'; |
Member
There was a problem hiding this comment.
this makes the config duplicate, sorry but this change is not needed. Feel free to remove the first export and keep the __dirname logic.
Author
There was a problem hiding this comment.
Thanks for the clarification!
I’ve removed the first export and kept the __dirname logic only.
Author
|
Thanks for the clarification! |
1 similar comment
Author
|
Thanks for the clarification! |
Member
|
Could you sign the CLA? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
webpack.config.jsexample 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
__dirnameusingimport.meta.urlandfileURLToPath, so users following the guide do not encounter runtime errors.What this PR changes
webpack.config.jsexample to be compatible with ESM__dirnameusage with the recommended ESM approachType of change
Breaking changes