Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Aug 13, 2023
1 parent 92d9e1b commit a353147
Show file tree
Hide file tree
Showing 8 changed files with 2,079 additions and 1,467 deletions.
3,403 changes: 2,010 additions & 1,393 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"html-webpack-plugin": "^5.5.0",
"image-size": "^1.0.2",
"nyc": "^15.0.0",
"prettier": "^2.7.1",
"prettier": "^3.0.1",
"rimraf": "^5.0.0",
"standard-version": "^9.5.0",
"typescript": "^5.0.4",
Expand Down
22 changes: 11 additions & 11 deletions src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ async function runCached(
compilation,
eTags,
idGenerator,
generator
generator,
) {
const latestSnapShot = snapshots.get(pluginInstance);

if (latestSnapShot) {
const cachedFavicons = faviconCache.get(latestSnapShot);
if (cachedFavicons) {
const isValid = await asPromise((cb) =>
compilation.fileSystemInfo.checkSnapshotValid(latestSnapShot, cb)
compilation.fileSystemInfo.checkSnapshotValid(latestSnapShot, cb),
);

if (isValid) {
Expand All @@ -87,8 +87,8 @@ async function runCached(
[],
[],
{},
cb
)
cb,
),
);

if (!newSnapShot) {
Expand All @@ -104,10 +104,10 @@ async function runCached(
compilation,
idGenerator,
eTags,
generator
generator,
)
: readFiles(absoluteFilePaths, compilation).then((fileContents) =>
generator(fileContents, idGenerator(fileContents))
generator(fileContents, idGenerator(fileContents)),
));

// Store the promise of the favicon compilation in cache
Expand Down Expand Up @@ -138,7 +138,7 @@ async function runWithFileCache(
compilation,
idGenerator,
eTags,
generator
generator,
) {
const fileSources = await readFiles(files, compilation);
const webpackCache = compilation.getCache('favicons-webpack-plugin');
Expand All @@ -147,7 +147,7 @@ async function runWithFileCache(
const cacheId = idGenerator(fileSources);

return webpackCache.providePromise(cacheId, eTag, () =>
generator(fileSources, cacheId)
generator(fileSources, cacheId),
);
}

Expand All @@ -168,16 +168,16 @@ function readFiles(absoluteFilePaths, compilation) {
const content = await asPromise((cb) =>
compilation.inputFileSystem.readFile(
path.resolve(compilation.compiler.context, absoluteFilePath),
cb
)
cb,
),
);

return {
filePath: absoluteFilePath,
hash: getContentHash(content),
content,
};
})
}),
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function resolvePublicPath(compilation, publicPath, assetPath) {

const fullAssetPath = url.resolve(
appendSlash(publicPathString || ''),
assetPath
assetPath,
);

return fullAssetPath;
Expand Down

0 comments on commit a353147

Please sign in to comment.