Skip to content

Commit f33d80f

Browse files
committed
A few minor code tweaks
- Usage of a declared variable - Usage of computed property keys - A little bit more readable variable definition
1 parent 9b61b62 commit f33d80f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ module.exports = function (content) {
99
const path = this.resourcePath;
1010

1111
this.cacheable && this.cacheable(true);
12-
this.addDependency(this.resourcePath);
12+
this.addDependency(path);
1313

1414
const cb = this.async();
1515
let component;
1616

1717
svg
18-
.optimize(content, { path: path })
18+
.optimize(content, { path })
1919
.then((result) => {
20-
const compiled = compiler.compile(result.data, { preserveWhitespace: false });
20+
const compiled = compiler.compile(result.data, {
21+
preserveWhitespace: false,
22+
});
2123

2224
component = transpile(`var render = function () {${compiled.render}};`);
2325
component += `var toString = function () {return ${JSON.stringify(path)}};`;

0 commit comments

Comments
 (0)