Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
refactor: Update to latest loader-utils (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
randak authored and joshwiens committed Dec 21, 2017
1 parent d2c7218 commit 304baef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ var regexSequences = [
[/\> \</g, "><"] // remove whitespace between tags
];

function getExtractedSVG(svgStr, query) {
function getExtractedSVG(svgStr, options) {
var config;
// interpolate hashes in classPrefix
if(!!query) {
config = assign({}, query);
if(!!options) {
config = assign({}, options);

if (!!config.classPrefix) {
const name = config.classPrefix === true ? '__[hash:base64:7]__' : config.classPrefix;
Expand Down Expand Up @@ -60,9 +60,9 @@ function SVGInlineLoader(content) {
this.cacheable && this.cacheable();
this.value = content;
// Configuration
var query = loaderUtils.parseQuery(this.query);
var options = loaderUtils.getOptions(this);

return "module.exports = " + JSON.stringify(getExtractedSVG(content, query));
return "module.exports = " + JSON.stringify(getExtractedSVG(content, options));
}

SVGInlineLoader.getExtractedSVG = getExtractedSVG;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"release": "standard-version"
},
"dependencies": {
"loader-utils": "^0.2.11",
"loader-utils": "^1.1.0",
"object-assign": "^4.0.1",
"simple-html-tokenizer": "^0.1.1"
},
Expand Down

0 comments on commit 304baef

Please sign in to comment.