add extra transform option

This commit is contained in:
Sebastian McKenzie
2015-04-15 14:59:26 -07:00
parent b483c16fe2
commit bb30a64f8d
3 changed files with 18 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ import Logger from "./logger";
import parse from "../../helpers/parse";
import Scope from "../../traversal/scope";
import slash from "slash";
import clone from "lodash/lang/clone";
import * as util from "../../util";
import path from "path";
import each from "lodash/collection/each";
@@ -120,7 +121,9 @@ export default class File {
throw new Error("Deprecated option " + key + ": " + option.deprecated);
}
if (val == null) val = option.default || val;
if (val == null) {
val = clone(option.default);
}
var optionParser = optionParsers[option.type];
if (optionParser) val = optionParser(key, val);

View File

@@ -15,8 +15,9 @@
"hidden": true
},
"pluginOptions": {
"hidden": true
"extra": {
"hidden": true,
"default": {}
},
"moduleId": {