UNPKG

kirbyup

Version:

Zero-config bundler for Kirby Panel plugins

14 lines (13 loc) 431 B
//#region src/client/plugin.ts const kirbyup = Object.freeze({ import(glob) { const modules = glob; return Object.entries(modules).reduce((accumulator, [path, component]) => { accumulator[getComponentName(path)] = component.default; return accumulator; }, {}); } }); function getComponentName(path) { return path.substring(path.lastIndexOf("/") + 1, path.lastIndexOf(".")).toLowerCase(); } //#endregion export { kirbyup };