From 72d0e6bed3b59cd956a362e38c1ff2de717afff6 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Sat, 24 Feb 2024 19:44:10 +0100 Subject: [PATCH] fix loading script multiple times in dev env on Hot reloading --- docs/src/components/Interpreter/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/components/Interpreter/index.tsx b/docs/src/components/Interpreter/index.tsx index 8a8d49b7..05ef4eee 100644 --- a/docs/src/components/Interpreter/index.tsx +++ b/docs/src/components/Interpreter/index.tsx @@ -18,7 +18,7 @@ export default function Interpreter(): JSX.Element { const prod = process.env.NODE_ENV === 'production'; - useScripts(prod ? [] : [ + useScripts((prod || globalThis.jQuery) ? [] : [ 'https://cdn.jsdelivr.net/npm/jquery', 'https://cdn.jsdelivr.net/combine/npm/jquery.terminal/js/jquery.terminal.min.js,npm/js-polyfills/keyboard.js,npm/prismjs/prism.js,npm/jquery.terminal/js/prism.js,npm/prismjs/components/prism-scheme.min.js', 'https://cdn.jsdelivr.net/gh/jcubic/lips@devel/lib/js/terminal.js',