svg-sprite-loader
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -11,2 +11,3 @@ var path = require('path'); | ||
* @property {String} [spriteModule] Sprite module name. You can define your own sprite module based on `./lib/web/sprite`. | ||
* @property {Boolean} [extract] Extract mode | ||
*/ | ||
@@ -18,3 +19,4 @@ | ||
prefixize: true, | ||
spriteModule: path.resolve(__dirname, 'lib/web/global-sprite') | ||
spriteModule: path.resolve(__dirname, 'lib/web/global-sprite'), | ||
extract: false | ||
}; |
19
index.js
@@ -48,9 +48,16 @@ var path = require('path'); | ||
content = doc.toString(SVGDoc.OUTPUT_FORMAT.SYMBOL); | ||
var output; | ||
return [ | ||
config.angularBaseWorkaround ? 'require("' + path.resolve(__dirname, 'lib/web/angular-base-workaround').replace(/\\/g, "/") + '");' : '', | ||
'var sprite = require("' + config.spriteModule.replace(/\\/g, "/") + '");', | ||
'var image = ' + JSON.stringify(content), | ||
'module.exports = sprite.add(image, "' + id + '");' | ||
].join(';\n'); | ||
if (config.extract) { | ||
output = ['module.exports = ' + JSON.stringify(content) + ';']; | ||
} else { | ||
output = [ | ||
config.angularBaseWorkaround ? 'require("' + path.resolve(__dirname, 'lib/web/angular-base-workaround').replace(/\\/g, "/") + '");' : '', | ||
'var sprite = require("' + config.spriteModule.replace(/\\/g, "/") + '");', | ||
'var image = ' + JSON.stringify(content) + ';', | ||
'module.exports = sprite.add(image, "' + id + '");' | ||
]; | ||
} | ||
return output.join('\n'); | ||
}; |
{ | ||
"name": "svg-sprite-loader", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "SVG sprite webpack loader", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22168
14
502