From 1d9ae7ac2303c7f5cd32f5c1675ced45e8845dda Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 12 Nov 2025 07:24:21 +0800 Subject: [PATCH] Load jQuery as early as possible to support custom scripts (#35926) (#35929) Backport #35926 by wxiaoguang Fix #35923 Co-authored-by: wxiaoguang --- web_src/js/index-domready.ts | 1 - web_src/js/index.ts | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web_src/js/index-domready.ts b/web_src/js/index-domready.ts index 8a3a27fa19..2ac9889758 100644 --- a/web_src/js/index-domready.ts +++ b/web_src/js/index-domready.ts @@ -1,4 +1,3 @@ -import './globals.ts'; import '../fomantic/build/fomantic.js'; import '../../node_modules/easymde/dist/easymde.min.css'; // TODO: lazy load in "switchToEasyMDE" diff --git a/web_src/js/index.ts b/web_src/js/index.ts index af53cc488c..153b8049c9 100644 --- a/web_src/js/index.ts +++ b/web_src/js/index.ts @@ -1,5 +1,10 @@ // bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors import './bootstrap.ts'; + +// many users expect to use jQuery in their custom scripts (https://docs.gitea.com/administration/customizing-gitea#example-plantuml) +// so load globals (including jQuery) as early as possible +import './globals.ts'; + import './webcomponents/index.ts'; import {onDomReady} from './utils/dom.ts';