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(nuxt): warn on external webpack/nitro/postcss config #22521

Merged
merged 10 commits into from Aug 8, 2023

Conversation

Lehoczky
Copy link
Contributor

@Lehoczky Lehoczky commented Aug 7, 2023

πŸ”— Linked issue

Well not an issue, but: https://youtu.be/a2r8Zr1hnEw?t=4166

I can create an issue too though:D

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The main change is that with this PR, we check whether the user has a webpack.config, postcss.config, nitro.config file and not just a vite.config file.

image
image

For better performance, this check runs parallel to the bundling process, see this line.

One caveat is that regardless of whether the user has chosen webpack or vite as a builder, we will always look for both of their config files (for example a warning will be made about an existing webpack config file, even if the user uses vite). I thought this is a pretty unlikely scenario, but if needed, I can adjust the code to take into consideration the used builder as well. It wouldn't be such a big change.

As a small additional improvement, the loadBuilder() function is now more type safe, and gracefully handles when a builder cannot be resolved:

Before:
image

After:
image

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Aug 7, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

This is nice πŸ‘Œ

@danielroe danielroe changed the title feat(nuxt): check for external webpack, nitro and postcss config feat(nuxt): warn on external webpack/nitro/postcss config Aug 8, 2023
@danielroe danielroe merged commit e373fa7 into nuxt:main Aug 8, 2023
25 checks passed
@github-actions github-actions bot mentioned this pull request Aug 8, 2023
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.

None yet

2 participants