Skip to content
Snippets Groups Projects
Commit a1e4d15d authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Don't hardcode the package name when looking up assets

The rollup json plugin allows accessing keyss with named exports,
so we can read the package name at build time.
parent 80d4faab
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ import {html, LitElement, css} from 'lit-element';
import {unsafeHTML} from 'lit-html/directives/unsafe-html.js';
import {until} from 'lit-html/directives/until.js';
import * as commonUtils from '../utils.js';
import {name as pkgName} from './../package.json';
// Use in case the icon fails to load
const errorIcon = `
......@@ -18,7 +19,7 @@ const errorIcon = `
`;
export function getIconSVGURL(name) {
return commonUtils.getAssetURL('dbp-common', 'icons/' + encodeURI(name) + '.svg');
return commonUtils.getAssetURL(pkgName, 'icons/' + encodeURI(name) + '.svg');
}
export function getIconCSS(name) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment