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

feat(nextjs): Create next.config.mjs when package.json has type: "module" #699

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

lforst
Copy link
Member

@lforst lforst commented Oct 30, 2024

This should create a little less friction in case users set type: module in their package json.

Copy link

github-actions bot commented Oct 30, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 9b3260a

@lforst lforst requested review from chargome and Lms24 October 30, 2024 15:59
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice!

Comment on lines +571 to +577
const packageJsonText = await fs.promises.readFile(
path.join(process.cwd(), 'package.json'),
'utf8',
);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const packageJson = JSON.parse(packageJsonText);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Copy link
Member

Choose a reason for hiding this comment

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

l: We can also use getPackageDotJson from clack-utils.ts instead of reading and parsing manually here

Copy link
Member Author

Choose a reason for hiding this comment

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

Thought about it but it had too much logic and logging in case it failed.

@lforst lforst merged commit 3d6537a into master Oct 30, 2024
16 checks passed
@lforst lforst deleted the lforst-create-mjs-heuristically branch October 30, 2024 16:06
@lforst lforst mentioned this pull request Oct 30, 2024
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