Skip to content

Commit

Permalink
Fix CSS Loader Detection False Positives
Browse files Browse the repository at this point in the history
`test.css` will falsely match on a loader that searches for the string `test`
  • Loading branch information
reubn committed Feb 19, 2022
1 parent 27affb4 commit 45ad0d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1853,11 +1853,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 45ad0d3

Please sign in to comment.