fix: revert copy rule glob filter

This commit is contained in:
Igor Randjelovic
2022-07-15 19:32:56 +02:00
parent 851c43ff43
commit a96445f530

View File

@ -71,15 +71,17 @@ export function applyCopyRules(config: Config) {
config.plugin('CopyWebpackPlugin').use(CopyWebpackPlugin, [
{
patterns: Array.from(copyRules)
.filter((glob) => {
if (process.env.NODE_ENV === 'test') {
return true;
}
// remove rules that do not match any paths
// prevents webpack watch mode from firing
// due to "removed" paths.
return globbySync(glob).length > 0;
})
// reverted: removes valid rules occasionally (ie fonts)
// todo: re-visit in future...
// .filter((glob) => {
// if (process.env.NODE_ENV === 'test') {
// return true;
// }
// // remove rules that do not match any paths
// // prevents webpack watch mode from firing
// // due to "removed" paths.
// return globbySync(glob).length > 0;
// })
.map((glob) => ({
from: glob,
context: entryDir,