Skip to content

Commit

Permalink
Update to use fast-glob and is-glob
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Jul 7, 2018
1 parent cbfe2a3 commit 6dff3f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/FSCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const md5 = require('./utils/md5');
const objectHash = require('./utils/objectHash');
const pkg = require('../package.json');
const logger = require('./Logger');
const {isGlob, glob} = require('./utils/glob');
const glob = require('fast-glob');
const isGlob = require('is-glob');

// These keys can affect the output, so if they differ, the cache should not match
const OPTION_KEYS = ['publicURL', 'minify', 'hmr', 'target', 'scopeHoist'];
Expand Down Expand Up @@ -34,9 +35,9 @@ class FSCache {
async getLastModified(filename) {
if (isGlob(filename)) {
let files = await glob(filename, {
strict: true,
nodir: true
onlyFiles: true
});

return (await Promise.all(
files.map(file => fs.stat(file).then(({mtime}) => mtime.getTime()))
)).reduce((a, b) => Math.max(a, b), 0);
Expand Down
7 changes: 0 additions & 7 deletions src/utils/glob.js

This file was deleted.

0 comments on commit 6dff3f2

Please sign in to comment.