Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Sep 20, 2022
1 parent f827a32 commit 22cd67f
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 27 deletions.
6 changes: 3 additions & 3 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ if (process.env.NODE_ENV !== 'development') {
// eslint-disable-next-line global-require, import/no-unresolved
assets = require('../manifest.json');
// eslint-disable-next-line global-require, import/no-unresolved
mainAssets = require('../stats.json').entrypoints.main.assets.filter(
asset => !asset.endsWith('.map'),
);
mainAssets = require('../stats.json').entrypoints.main.assets
.filter(asset => !asset.name.endsWith('.map'))
.map(asset => asset.name);

const manifestFiles = mainAssets.filter(asset =>
asset.startsWith('js/runtime'),
Expand Down
5 changes: 5 additions & 0 deletions app/util/mapIconUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ function getImageFromSpriteSync(icon, width, height, fill) {
return null;
}
const symbol = document.getElementById(icon);
if (!symbol) return null;
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('width', width);
svg.setAttribute('height', height);
Expand Down Expand Up @@ -237,6 +238,10 @@ function getImageFromSpriteAsync(icon, width, height, fill) {
return new Promise(resolve => {
// TODO: check that icon exists using MutationObserver
const image = getImageFromSpriteSync(icon, width, height, fill);
if (!image) {
resolve(null);
return;
}
image.onload = () => resolve(image);
});
}
Expand Down
5 changes: 0 additions & 5 deletions build/contextHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ function faviconPluginFromConfig(config) {
// The prefix for all image files (might be a folder or a name)
prefix: `assets/icons-${config.CONFIG}-[contenthash]/`,

// todo: these have been removed
// Emit all stats of the generated icons
// emitStats: true,
// // The name of the json containing all favicon information
// statsFilename: `assets/iconstats-${config.CONFIG}.json`,
inject: false,
favicons: {
appName: config.title,
Expand Down
1 change: 0 additions & 1 deletion iconstats-default.json

This file was deleted.

1 change: 0 additions & 1 deletion iconstats-hameenlinna.json

This file was deleted.

Loading

0 comments on commit 22cd67f

Please sign in to comment.