From 70cd01015df406e7cd02c3bfa04f76dbe312a878 Mon Sep 17 00:00:00 2001 From: Reuben <4957964+reubn@users.noreply.github.com> Date: Wed, 23 Feb 2022 12:28:17 +0000 Subject: [PATCH] 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` --- packages/next/build/webpack-config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index f030cf3139e4337..abd2b01a08296b7 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -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))) {