Skip to content

Commit

Permalink
Change unique templates filtration
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed Aug 1, 2021
1 parent 8316194 commit 331f831
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
11 changes: 3 additions & 8 deletions src/lib/ast/get-templates-imports.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {getFirstExistedPath} from '../utils/get-first-existed-path';
import {getPossiblePaths} from '../utils/get-possible-paths';
import {isUniqueTemplate} from '../utils/is-unique-template';
import {isUniqueAsset} from '../utils/is-unique-asset';

import {getDependenciesTemplates} from './get-dependencies-templates';

Expand All @@ -21,11 +21,6 @@ async function filterPaths([path, paths]) {
}
}


function filterUniqueTemplates(templates) {
return templates.filter(isUniqueTemplate);
}

/**
* @param {Object} loaderContext
* @param {nunjucks.nodes.Root} nodes
Expand All @@ -41,9 +36,9 @@ export function getTemplatesImports(loaderContext, nodes, searchPaths) {
}

return true;
});
}).filter(isUniqueAsset);
const possiblePaths = getPossiblePaths(templateDeps, searchPaths);
const resolvedTemplates = possiblePaths.map(filterPaths);

return Promise.all(resolvedTemplates).then(filterUniqueTemplates);
return Promise.all(resolvedTemplates);
}
14 changes: 0 additions & 14 deletions src/lib/utils/is-unique-template.js

This file was deleted.

0 comments on commit 331f831

Please sign in to comment.