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 5, 2021
1 parent 1bf68b0 commit 29e43bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/webpack/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ const STATIC = /\.(eot|woff2?|ttf|otf|svg|png|jpe?g|gif|webp|mp4|mp3|ogg|pdf|htm

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

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

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

0 comments on commit 29e43bc

Please sign in to comment.