cleanup(turbopack) Show users an error message when Webpack loaders have a glob in only the extension (#81084)
This PR adds validation for webpack loader rules in Next.js
configuration to prevent a common issue where users define wildcard
extensions without corresponding wildcard patterns in the `as` option.
This situation causes all modules to be transformed into the same name,
resulting in duplicate module errors.
The changes:
- Add a new `InvalidLoaderRuleError` issue type that provides clear
error messages when this misconfiguration is detected
- Check if an extension contains a wildcard (`*`) but the `rename_as`
option does not
- Display helpful error messages with links to documentation when this
issue is found
- Update the `webpack_rules` function to accept the project path for
error reporting
This validation helps users avoid confusing duplicate module errors by
providing clear guidance on how to properly configure webpack loaders in
Next.js.
