cherry icon indicating copy to clipboard operation
cherry copied to clipboard

cherry.embed/compile-string ignores (require ...) expression

Open kloimhardt opened this issue 1 year ago • 2 comments

When cherry.embed/compile-string is called within HTML

<html>
   <body>
       <script type="module">
        import {compile_string} from "./out/main.js";
        console.log(compile_string('(require ["A"]) (equire ["A"])'))
       </script>
   </body>
</html>

main.js being a CLJS advanced Shadow compiled ES6 module, the output on the console is

equire.call(null, cljs.core.vector("A"));

The expectation is that the output includes a JS import

import "A";
equire.call(null, cljs.core.vector("A"));

To reproduce issue: cherry_require.html

kloimhardt avatar Apr 23 '23 06:04 kloimhardt