My plugin contains html templates that I keep in the assets folder, and I'm trying to find a way to load them in so I can use their raw text contents.
I'm using skpm and have tried using their fetch polyfill without any luck - could anyone suggest what I'm doing wrong?
const template = context.plugin.urlForResourceNamed("template.html");
fetch(template).then(response => response.text()).then(text => log(text)).catch(e => log(e));
I get an error saying: "-[NSURL length]: unrecognized selector sent to instance 0x6080022a75c0"
I'm guessing that fetch maybe doesn't like a path starting in "file:///"?