diff --git a/scripts/build-src.js b/scripts/build-src.js index c6819723..3f4d2ece 100644 --- a/scripts/build-src.js +++ b/scripts/build-src.js @@ -35,9 +35,7 @@ function src() { const bundler = new Parcel(entryFile, parcelOptions); const bundleMainScript = bundler.bundle(); - const copyIcons = fs - .ensureDir(path.resolve(distPath, 'svg')) - .then(() => fs.copy(destSVGPath, path.resolve(distPath, 'svg'))); + const copyIcons = fs.copy(destSVGPath, distPath); const copyManifest = fs.copy( path.resolve(srcPath, 'manifest.json'), diff --git a/src/main.js b/src/main.js index ce569f28..bd6dfca5 100644 --- a/src/main.js +++ b/src/main.js @@ -99,7 +99,7 @@ function replaceIcon(itemRow, iconMap, languageMap) { if (!iconName) return; const newSVG = document.createElement('img'); - newSVG.src = chrome.runtime.getURL(`svg/${iconName + '.svg'}`); + newSVG.src = chrome.runtime.getURL(`${iconName + '.svg'}`); svgEl.getAttributeNames().forEach((att) => newSVG.setAttribute(att, svgEl.getAttribute(att))); svgEl.parentNode.replaceChild(newSVG, svgEl); diff --git a/src/manifest.json b/src/manifest.json index 28577c04..e5e97a03 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -22,6 +22,6 @@ } ], "web_accessible_resources": [ - "svg/*.svg" + "*.svg" ] }