UNPKG

assetgraph

Version:

An auto discovery dependency graph based optimization framework for web pages and applications

13 lines (12 loc) 376 B
for (const fileName of require('fs').readdirSync(__dirname)) { if (/\.js$/.test(fileName) && fileName !== 'index.js') { const type = fileName.replace(/\.js$/, ''); Object.defineProperty(exports, 'type', { get() { const Constructor = require(`./${fileName}`); Constructor.prototype.type = type; return Constructor; } }); } }