Skip to content
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

docs: updated getting started guide to correct webpack config file extension to support CJS syntax #7518

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RajeevPullat
Copy link

Updated getting started guide to correct webpack config file extension to support CJS syntax

The docs used import statement in index.js which requires setting type: "module". There is a PR raised for the same PR:7516. This PR to correct the webpack config file extension. The CommonJS code won't work in *.js extension and will throw below error.

[webpack-cli] ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension

So its best changed to webpack.config.cjs.

…ension to support CJS syntax

The docs used import statement in index.js which requires setting `type: "module"`. There is a PR for the same `https://github.com/webpack/webpack.js.org/pull/7516`. This is to correct the webpack config file. The commonjs code won't work in *.js extension. So its changed to *.cjs.
Copy link

vercel bot commented Jan 11, 2025

@RajeevPullat is attempting to deploy a commit to the Webpack Docs Team on Vercel.

A member of the Team first needs to authorize it.

@Abhijeet641
Copy link

@RajeevPullat sir, did you fix the lint check ? could you please review my pr once #7513

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.

2 participants