node: remove workaround for font imports with relative paths

Commit a76c3ec789 fixes the underlying issue.
This commit is contained in:
Simon Hausmann 2023-10-25 15:04:55 +02:00
parent 46b7839db2
commit 2fc418251b

View file

@ -294,12 +294,9 @@ export class CompileError extends Error {
/**
* Loads the given slint file and returns a constructor to create an instance of the exported component.
*/
export function loadFile(filePath: string) : Object {
// this is a workaround that fixes an issue there resources in slint files cannot be loaded if the
// file path is given as relative path
let absoluteFilePath = path.resolve(filePath);
export function loadFile(filePath: string): Object {
let compiler = new napi.ComponentCompiler;
let definition = compiler.buildFromPath(absoluteFilePath);
let definition = compiler.buildFromPath(filePath);
let diagnostics = compiler.diagnostics;