We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55506da commit 013e726Copy full SHA for 013e726
index.js
@@ -0,0 +1,19 @@
1
+var svg = require('svgo');
2
+
3
+var svgo = new svg({
4
+ plugins: ['removeDoctype', 'removeComments'],
5
+});
6
7
+module.exports = function (content) {
8
+ this.cacheable && this.cacheable(true);
9
+ this.addDependency(this.resourcePath);
10
11
+ var cb = this.async();
12
13
+ svgo.optimize(content, function (result) {
14
+ if (result.error) {
15
+ return cb(result.error);
16
+ }
17
+ cb(null, "module.exports = {template: '" + result.data + "'};");
18
+ });
19
+};
0 commit comments