MCPcopy Create free account
hub / github.com/babel/minify / getPlugins

Function getPlugins

scripts/plugin-contribution.js:100–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100function getPlugins() {
101 return fs
102 .readdirSync(path.join(__dirname, "../packages"))
103 .filter(dir => {
104 if (!isDir(path.join(__dirname, "../packages", dir))) return false;
105 if (dir.indexOf("babel-plugin-") !== 0) return false;
106 try {
107 require(`../packages/${dir}`);
108 return true;
109 } catch (e) {
110 return false;
111 }
112 })
113 .map(pluginName => ({
114 name: pluginName,
115 plugin: require(`../packages/${pluginName}`)
116 }));
117}
118
119function getParseTime(code) {
120 // const context = vm.createContext();

Callers 1

runFunction · 0.70

Calls 1

isDirFunction · 0.70

Tested by

no test coverage detected