Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #354

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading