silphius/app/ecs-components/index.js
2024-07-07 17:31:39 -05:00

15 lines
367 B
JavaScript

import gather from '@/util/gather.js';
const Gathered = gather(
import.meta.glob(['./*.js', '!./*.test.js'], {eager: true, import: 'default'}),
);
const Components = {};
for (const componentName in Gathered) {
Components[componentName] = class Named extends Gathered[componentName] {
static componentName = componentName;
};
}
export default Components;