From 8a78bf3b7d9ae1925ae407fbf413cc74418c17be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr> Date: Tue, 25 Oct 2022 17:13:05 +0200 Subject: [PATCH] [ivette] Dome.getStatic() --- ivette/src/dome/renderer/dome.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ivette/src/dome/renderer/dome.tsx b/ivette/src/dome/renderer/dome.tsx index ef88eecd134..024312ea19f 100644 --- a/ivette/src/dome/renderer/dome.tsx +++ b/ivette/src/dome/renderer/dome.tsx @@ -119,6 +119,16 @@ export function getWorkingDir(): string { return System.getWorkingDir(); } /** Current process ID.. */ export function getPID(): number { return System.getPID(); } +// The __static path is provided by webpack at execution time, but the static +// type system is not aware of that for now. This is a workaround to avoid +// an error during compilation. +declare const __static: string; + +/** Path to application static resources. */ +export function getStatic(file?: string): string { + return file ? System.join(__static, file) : __static; +} + // -------------------------------------------------------------------------- // --- Application Emitter // -------------------------------------------------------------------------- -- GitLab