Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
Better error message if file is missing ai#221
  • Loading branch information
ivanhofer committed May 6, 2021
1 parent 29e43bc commit 19c5e36
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/webpack/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ let writeFile = promisify(fs.writeFile)
const STATIC = /\.(eot|woff2?|ttf|otf|svg|png|jpe?g|gif|webp|mp4|mp3|ogg|pdf|html|ico|md)$/

function checkIfFilesExist(limitConfig, check) {
let cwd = limitConfig.cwd || process.cwd()

let filesToCheck = new Set()
if (check.files) {
for (let file of check.files) {
filesToCheck.add(file)
}
}
if (check.path) {
filesToCheck.add(join(limitConfig.cwd, check.path))
filesToCheck.add(join(cwd, check.path))
}

let filesToIgnore = (check.ignore || []).filter(Boolean).map(file => join(limitConfig.cwd, file))

let filesToIgnore = (check.ignore || []).filter(Boolean).map(file => join(cwd, file))
filesToCheck = Array.from(filesToCheck).filter(file => !filesToIgnore.includes(file))

if (filesToIgnore.length && !filesToCheck.length) {
Expand Down

0 comments on commit 19c5e36

Please sign in to comment.