add canRun check for playground transformers

This commit is contained in:
Sebastian McKenzie 2015-02-01 16:20:32 +11:00
parent c7a616730c
commit 981d3e40f8
2 changed files with 3 additions and 0 deletions

View File

@ -41,6 +41,8 @@ TransformerPass.prototype.canRun = function () {
if (transformer.experimental && !opts.experimental) return false;
if (transformer.playground && !opts.playground) return false;
return true;
};

View File

@ -17,6 +17,7 @@ var each = require("lodash/collection/each");
function Transformer(key, transformer, opts) {
this.manipulateOptions = transformer.manipulateOptions;
this.experimental = !!transformer.experimental;
this.playground = !!transformer.playground;
this.secondPass = !!transformer.secondPass;
this.optional = !!transformer.optional;
this.handlers = this.normalise(transformer);