silphius/app/ecs-components/index.js

15 lines
367 B
JavaScript
Raw Normal View History

2024-06-22 22:33:34 -05:00
import gather from '@/util/gather.js';
2024-06-10 22:42:30 -05:00
2024-06-26 21:08:09 -05:00
const Gathered = gather(
2024-07-07 17:31:27 -05:00
import.meta.glob(['./*.js', '!./*.test.js'], {eager: true, import: 'default'}),
2024-06-14 15:18:55 -05:00
);
const Components = {};
2024-06-26 21:08:09 -05:00
for (const componentName in Gathered) {
Components[componentName] = class Named extends Gathered[componentName] {
static componentName = componentName;
};
2024-06-14 15:18:55 -05:00
}
export default Components;