feat(nuxt): warn on external webpack
/nitro
/postcss
config
#22521
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.
π Linked issue
Well not an issue, but: https://youtu.be/a2r8Zr1hnEw?t=4166
I can create an issue too though:D
β Type of 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 avite.config
file.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:
After:
π Checklist