UNPKG

456 BJavaScriptView Raw
1import _ from 'underscore';
2
3import fileHasDependency from './file-has-dependency.js';
4
5export default ({ config, path }) =>
6 Promise.all(
7 _.map(config, async ({ cache }) => {
8 const { buffers, files } = cache;
9 delete buffers[path];
10 delete files[path];
11 await Promise.all(
12 _.map(files, async (file, key) => {
13 if (fileHasDependency({ file: await file, path })) delete files[key];
14 })
15 );
16 })
17 );