From 2995da2625c80f4c9de2d20e49b39957178a87e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 4 Apr 2024 15:30:56 +0200 Subject: [PATCH] DEV: add "load-morphlex" wrapper... (#26514) * DEV: add "load-morphlex" wrapper... ... so plugins can import and use morphlex. Co-authored-by: David Taylor --- app/assets/javascripts/discourse/app/lib/load-morphlex.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/assets/javascripts/discourse/app/lib/load-morphlex.js diff --git a/app/assets/javascripts/discourse/app/lib/load-morphlex.js b/app/assets/javascripts/discourse/app/lib/load-morphlex.js new file mode 100644 index 00000000000..eb2c0ea7e46 --- /dev/null +++ b/app/assets/javascripts/discourse/app/lib/load-morphlex.js @@ -0,0 +1,7 @@ +/* +Plugins & themes are unable to async-import npm modules directly. +This wrapper provides them with a way to use morphlex, while keeping the `import()` in core's codebase. +*/ +export default async function loadMorphlex() { + return await import("morphlex"); +}