Make sure icons are bundled
Summary: Make sure icons are prefetched for flipper-server prod builds, like we do for electron, so that the user doesn't need an internet connection to see icons Reviewed By: nikoant Differential Revision: D33296389 fbshipit-source-id: bfa92d78d8d77030238e5cca10d7aa6dcfb88e8b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
72fa481d27
commit
54dacb7e5d
@@ -7,8 +7,8 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {FlipperServer, FlipperServerConfig} from 'flipper-common';
|
||||
import {RenderHost} from 'flipper-ui-core';
|
||||
import {FlipperServer, FlipperServerConfig, isProduction} from 'flipper-common';
|
||||
import type {RenderHost} from 'flipper-ui-core';
|
||||
|
||||
export function initializeRenderHost(
|
||||
flipperServer: FlipperServer,
|
||||
@@ -79,6 +79,12 @@ export function initializeRenderHost(
|
||||
// the 'static' folder is mounted as static middleware in Express at the root
|
||||
return '/' + path;
|
||||
},
|
||||
getLocalIconUrl(icon, url) {
|
||||
if (isProduction()) {
|
||||
return `icons/${icon.name}-${icon.variant}-${icon.size}@${icon.density}x.png`;
|
||||
}
|
||||
return url;
|
||||
},
|
||||
} as RenderHost;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user