From 2019b3263f5358cadd4176d88b957cbc12b6fcc8 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Thu, 19 Dec 2024 17:05:28 +0100 Subject: [PATCH] Fix #99: make js/import work (#100) --- CHANGELOG.md | 4 ++++ src/scittle/core.cljs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f77afa..2f0fba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ +## v0.6.21 (2024-12-19) + +- [#99](https://github.com/babashka/babashka/issues/99): make `js/import` work + ## v0.6.20 (2024-11-24) - [#55](https://github.com/babashka/babashka/issues/55): create gh-pages dir before using. diff --git a/src/scittle/core.cljs b/src/scittle/core.cljs index 34bc02a..beaa32e 100644 --- a/src/scittle/core.cljs +++ b/src/scittle/core.cljs @@ -57,6 +57,8 @@ :ns-aliases {'clojure.pprint 'cljs.pprint} :features #{:scittle :cljs}})) +(unchecked-set js/globalThis "import" (js/eval "(x) => import x")) + (def !last-ns (volatile! @sci/ns)) (defn- -eval-string [s]