forked from webiny/webiny-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.adiorc.js
29 lines (28 loc) · 1.08 KB
/
.adiorc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const get = require("lodash.get");
const LOAD_COMPONENTS_PREFIX = ["@webiny/", "@serverless/"];
module.exports = {
parser: {
plugins: ["jsx", "classProperties", "dynamicImport", "throwExpressions", "typescript"]
},
traverse: ({ path, push }) => {
// We try to detect "this.load("...")" calls inside of Serverless components.
const { node } = path;
if (node.type === "CallExpression" && get(node, "callee.property.name") === "load") {
const possiblePackage = get(node, "arguments.0.value");
if (typeof possiblePackage === "string") {
LOAD_COMPONENTS_PREFIX.forEach(prefix => {
if (possiblePackage.startsWith(prefix)) {
return push(possiblePackage);
}
});
}
}
},
ignore: {
src: ["path", "os", "fs", "util", "events", "crypto", "aws-sdk"],
dependencies: ["@babel/runtime"],
devDependencies: true
},
ignoreDirs: ["node_modules", "dist"],
packages: ["packages/*", "components/*"]
};