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

Commit 304baef

Browse files
randakjoshwiens
authored andcommittedDec 21, 2017
refactor: Update to latest loader-utils (#72)
1 parent d2c7218 commit 304baef

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ var regexSequences = [
2020
[/\> \</g, "><"] // remove whitespace between tags
2121
];
2222

23-
function getExtractedSVG(svgStr, query) {
23+
function getExtractedSVG(svgStr, options) {
2424
var config;
2525
// interpolate hashes in classPrefix
26-
if(!!query) {
27-
config = assign({}, query);
26+
if(!!options) {
27+
config = assign({}, options);
2828

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

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

6868
SVGInlineLoader.getExtractedSVG = getExtractedSVG;

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"release": "standard-version"
1111
},
1212
"dependencies": {
13-
"loader-utils": "^0.2.11",
13+
"loader-utils": "^1.1.0",
1414
"object-assign": "^4.0.1",
1515
"simple-html-tokenizer": "^0.1.1"
1616
},

0 commit comments

Comments
 (0)
This repository has been archived.