Clojurians
#cljs-dev
<
2017-09-26
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

roman01la21:09:19

Is it supported to refer to a var in a scoped NPM package by its fully qualified name?

roman01la22:09:06

(require '["@scope/package" :as p])

(p/myFun) ;; this works

;; but how do I do this?
(@scope/package/myFun)

anmonteiro22:09:45

@roman01la not supported why do you need it

roman01la22:09:39

was going to put it in a macro

anmonteiro22:09:59

@roman01la you can use the alias name

roman01la22:09:31

this means explicit require whenever the macro is applied

anmonteiro22:09:53

@roman01la soooooo

anmonteiro22:09:17

if it’s a macro, poke into (:js-module-index @cljs.env/*compiler*)

anmonteiro22:09:31

and find the actual module name

roman01la22:09:53

:astonished:

anmonteiro22:09:55

which should look like module$Users$foo$project$node_modules$modulename$

roman01la22:09:07

it is, going to check this, thanks