remove internal protection
This commit is contained in:
parent
f9c7d0d095
commit
6141c66a63
3
.babelrc
3
.babelrc
@ -2,6 +2,5 @@
|
|||||||
"stage": 0,
|
"stage": 0,
|
||||||
"loose": ["all"],
|
"loose": ["all"],
|
||||||
"blacklist": ["es6.tailCall"],
|
"blacklist": ["es6.tailCall"],
|
||||||
"optional": ["optimisation.flow.forOf"],
|
"optional": ["optimisation.flow.forOf"]
|
||||||
"plugins": ["./tools/build-plugins/protect"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
import path from "path";
|
|
||||||
|
|
||||||
var root = path.resolve(__dirname, "../../../");
|
|
||||||
|
|
||||||
export default function (module) {
|
|
||||||
if (module.parent && module.parent.filename.indexOf(root) !== 0) {
|
|
||||||
throw new Error("Don't hotlink internal Babel files.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
var path = require("path");
|
|
||||||
|
|
||||||
module.exports = function (babel) {
|
|
||||||
var t = babel.types;
|
|
||||||
|
|
||||||
return new babel.Plugin("protect-internal-apis", {
|
|
||||||
visitor: {
|
|
||||||
Program: function (node, parent, scope, file) {
|
|
||||||
if (file.opts.filename.indexOf("tools/protect") >= 0) return;
|
|
||||||
if (file.opts.filename.indexOf("templates") >= 0) return;
|
|
||||||
|
|
||||||
var from = "/" + path.dirname(file.opts.filename.replace(/^src/, "lib"));
|
|
||||||
var to = "/lib/babel/tools";
|
|
||||||
|
|
||||||
var protectLoc = "./" + path.relative(from, to) + "/protect.js";
|
|
||||||
|
|
||||||
this.unshiftContainer("body", [
|
|
||||||
t.expressionStatement(t.callExpression(file.addImport(protectLoc), [t.identifier("module")]))
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user