diff --git a/index.js b/index.js index 2da303c..4acb456 100644 --- a/index.js +++ b/index.js @@ -37,8 +37,6 @@ function getFilesAndDeps(patterns, context) { var globDirs = glob.sync(path.dirname(globExp) + '/', globOptions); directoryDeps = directoryDeps.concat(globDirs.map(absolute(context))); - - } // Re-work the files array. @@ -58,7 +56,6 @@ function getFilesAndDeps(patterns, context) { files: filesDeps } }; - } module.exports = function (content) { @@ -102,19 +99,28 @@ module.exports = function (content) { baseClass: config.baseClass || "icon", classPrefix: "classPrefix" in config ? config.classPrefix : "icon-" }, - rename: (typeof config.rename == "function" ? config.rename : function (f) { - return path.basename(f, ".svg"); - }), dest: "", - writeFiles: false + writeFiles: false, + formatOptions: config.formatOptions || {} }; + // This originally was in the object notation itself. + // Unfortunately that actually broke my editor's syntax-highlighting... + // ... what a shame. + if(typeof config.rename == "function") { + fontconf.rename = config.rename; + } else { + fontconf.rename = function(f) { + return path.basename(f, ".svg"); + } + } + if (config.cssTemplate) { fontconf.cssTemplate = absolute(this.context, config.cssTemplate); } - for (var option in config.templateOptions) { - if (config.templateOptions.hasOwnProperty(option)) { + for(var option in config.templateOptions) { + if(config.templateOptions.hasOwnProperty(option)) { fontconf.templateOptions[option] = config.templateOptions[option]; } } diff --git a/package.json b/package.json index 9a7c91b..5fe92a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fontgen-loader", - "version": "0.2.0", + "version": "0.2.1", "description": "A WebPack loader to automaticaly generate font files and CSS to make your own icon font", "repository": "DragonsInn/fontgen-loader", "main": "index.js", @@ -21,7 +21,7 @@ "license": "MIT", "dependencies": { "loader-utils": "^0.2.10", - "webfonts-generator": "^0.3.0", + "webfonts-generator": "^0.3.2", "glob": "^6.0.2" }, "devDependencies": {