Skip to content

Commit

Permalink
Fix CSS Loader Detection False Positives (#34584)
Browse files Browse the repository at this point in the history
`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`
  • Loading branch information
reubn committed Feb 23, 2022
1 parent 99ee222 commit 70cd010
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1848,11 +1848,11 @@ export default async function getBaseWebpackConfig(
}

const fileNames = [
'/tmp/test.css',
'/tmp/test.scss',
'/tmp/test.sass',
'/tmp/test.less',
'/tmp/test.styl',
'/tmp/NEXTJS_CSS_DETECTION_FILE.css',
'/tmp/NEXTJS_CSS_DETECTION_FILE.scss',
'/tmp/NEXTJS_CSS_DETECTION_FILE.sass',
'/tmp/NEXTJS_CSS_DETECTION_FILE.less',
'/tmp/NEXTJS_CSS_DETECTION_FILE.styl',
]

if (rule instanceof RegExp && fileNames.some((input) => rule.test(input))) {
Expand Down

0 comments on commit 70cd010

Please sign in to comment.