Unverified Commit 70cd0101 authored by Reuben's avatar Reuben Committed by GitHub

Fix CSS Loader Detection False Positives (#34584)

`test.css`, `test.scss` etc. will falsely match on a loader that searches for the string `test`


fixes #34583



## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
parent 99ee2225
...@@ -1848,11 +1848,11 @@ export default async function getBaseWebpackConfig( ...@@ -1848,11 +1848,11 @@ export default async function getBaseWebpackConfig(
} }
const fileNames = [ const fileNames = [
'/tmp/test.css', '/tmp/NEXTJS_CSS_DETECTION_FILE.css',
'/tmp/test.scss', '/tmp/NEXTJS_CSS_DETECTION_FILE.scss',
'/tmp/test.sass', '/tmp/NEXTJS_CSS_DETECTION_FILE.sass',
'/tmp/test.less', '/tmp/NEXTJS_CSS_DETECTION_FILE.less',
'/tmp/test.styl', '/tmp/NEXTJS_CSS_DETECTION_FILE.styl',
] ]
if (rule instanceof RegExp && fileNames.some((input) => rule.test(input))) { if (rule instanceof RegExp && fileNames.some((input) => rule.test(input))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment