UNPKG

361 BJavaScriptView Raw
1const svgToVue = require('svg-to-vue');
2const { getOptions } = require('loader-utils');
3
4module.exports = function (content) {
5 const callback = this.async();
6 const { svgo } = getOptions(this) || {};
7
8 svgToVue(content, {
9 svgoPath: this.resourcePath,
10 svgoConfig: svgo,
11 })
12 .then(component => callback(null, component))
13 .catch(callback);
14};