ignore templates folder in protect plugin

This commit is contained in:
Sebastian McKenzie 2015-06-25 14:33:38 +01:00
parent 95d830fde0
commit a8e23d2eb9

View File

@ -5,6 +5,7 @@ module.exports = function (babel) {
visitor: { visitor: {
Program: function (node, parent, scope, file) { Program: function (node, parent, scope, file) {
if (file.opts.filename.indexOf("tools/protect") >= 0) return; if (file.opts.filename.indexOf("tools/protect") >= 0) return;
if (file.opts.filename.indexOf("templates") >= 0) return;
this.unshiftContainer("body", [ this.unshiftContainer("body", [
t.expressionStatement(t.callExpression(file.addImport("babel-core/lib/babel/tools/protect"), [t.identifier("module")])) t.expressionStatement(t.callExpression(file.addImport("babel-core/lib/babel/tools/protect"), [t.identifier("module")]))