webpack.js.org icon indicating copy to clipboard operation
webpack.js.org copied to clipboard

Update documentation examples to ES6 #7636

Open DeekshaVarshney123 opened this issue 4 weeks ago • 7 comments

Hello Webpack Team,

This Pull Request addresses Issue #7636 by updating documentation examples to use ES Modules syntax (import/export default) instead of CommonJS (require/module.exports).


🛠️ Current Changes

For an initial review, I have only updated two key guides in the guides section:

  1. src/content/guides/getting-started.mdx
  2. src/content/guides/asset-management.mdx

💡 Request for Review

Could you please review these changes to ensure:

  • The ES Modules syntax has been implemented correctly across all webpack.config.js code blocks in these two guides.
  • The approach (changing syntax within diff blocks where necessary) aligns with the documentation contribution standards.

If the changes are satisfactory, I will proceed to update the remaining documentation files for Issue #7636. If any modifications or additional steps are required, please let me know.

Thank you for your time!

DeekshaVarshney123 avatar Nov 20 '25 06:11 DeekshaVarshney123

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

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 20 '25 06:11 vercel[bot]

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: DeekshaVarshney123 / name: Deeksha Varshney (046f81c7415625db04acb92c1086784228125378, 050ae9a0bd5177b883ff07bbb6bab93eb00dad51, 085a47e7ae799c2c4d4a5dd863b26f9f72a1bf70, 32434357acee5f766a549f8be5f018a5b355ad77, 53cba256b7f34a71535f407274baf86361b6d15b, 6e07c8cf5e743de88b5cd19378309ab93243d83e, edfae50e5ead4df272e0ac7f9dd957a16e8ab54e, f6c8ade1b792687fa5375dfa62f856f86635dd8e)

Hello Webpack Maintainers,

I'm confirming that the Link Check, Unit Test, and Lint checks are all failing due to a dependency lockfile error.

The logs show: error Your lockfile needs to be updated, but yarn was run with "--frozen-lockfile".

This indicates that either the yarn.lock file is missing or severely outdated in my branch's history, blocking the CI from proceeding. Since I cannot update the lockfile locally (due to CI configuration dependencies), could a maintainer please update the yarn.lock file in the main branch or bypass the --frozen-lockfile check?

My code changes (ES Modules syntax updates) are clean and ready for review once the tests pass.

Thank you for your help! Fixes #7636

DeekshaVarshney123 avatar Nov 20 '25 07:11 DeekshaVarshney123

Hi @evenstensberg ,

Just following up on my previous question regarding the strategy for the remaining files.

All checks are passing on the initial two guides, and I'm ready to proceed with the full update using the ES Module pattern once I get your confirmation.

Thanku for your time!

DeekshaVarshney123 avatar Dec 03 '25 18:12 DeekshaVarshney123

@evenstensberg

Thanks again for confirming! I've removed the redundant ajv-keywords dependency and pushed the clean commit. All checks are passing now.

I am awaiting your direction on proceeding with the remaining files, as per my previous question. Thank you!

DeekshaVarshney123 avatar Dec 06 '25 14:12 DeekshaVarshney123

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
webpack-js-org Ready Ready Preview Comment Dec 8, 2025 6:15pm

vercel[bot] avatar Dec 08 '25 18:12 vercel[bot]

Looks good, change all module.exports. You can just to a filter search in vscode (Ctrl + F), and then replace module.exports with export default. Thanks!

evenstensberg avatar Dec 08 '25 18:12 evenstensberg

@evenstensberg ,

I have finished the ESM syntax migration and resolved all merge conflicts.However, the E2E tests are still failing with a ReferenceError (component not defined) during Server-Side Rendering (SSR). I have tried many fixes in server.jsx and mdx-components.js. but the error is not resolved.

Could you please check if the files I updated are correct for the ESM migration and advise on the final fix to get this CI check passed? Thank you!

DeekshaVarshney123 avatar Dec 13 '25 20:12 DeekshaVarshney123

Could you fix CI? https://github.com/webpack/webpack.js.org/actions/runs/20196884837/job/57982144174?pr=7704#step:6:21511

evenstensberg avatar Dec 15 '25 16:12 evenstensberg

@evenstensberg ,

Yes, I am working on fixing the CI failure. I will update you as soon as the checks pass. Thank you for your patience!

DeekshaVarshney123 avatar Dec 16 '25 14:12 DeekshaVarshney123