gitea/web_src/js/index.ts
2025-07-06 04:55:16 +00:00

14 lines
696 B
TypeScript

// bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors
import './bootstrap.ts';
import './webcomponents/index.ts';
import {onDomReady} from './utils/dom.ts';
// TODO: There is a bug in htmx, it incorrectly checks "readyState === 'complete'" when the DOM tree is ready and won't trigger DOMContentLoaded
// Then importing the htmx in our onDomReady will make htmx skip its initialization.
// If the bug would be fixed (https://github.com/bigskysoftware/htmx/pull/3365), then we can only import htmx in "onDomReady"
import 'htmx.org';
onDomReady(async () => {
await import(/* webpackChunkName: "index-domready" */'./index-domready.ts');
});