This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-14
Channels
- # beginners (33)
- # cider (17)
- # clara (13)
- # cljs-dev (7)
- # clojars (1)
- # clojure (47)
- # clojure-brasil (1)
- # clojure-dev (4)
- # clojure-italy (3)
- # clojure-russia (4)
- # clojure-uk (1)
- # clojurescript (4)
- # core-async (4)
- # core-logic (6)
- # cursive (7)
- # datomic (1)
- # emacs (35)
- # fulcro (56)
- # hoplon (7)
- # jobs-discuss (89)
- # lumo (6)
- # numerical-computing (1)
- # onyx (86)
- # parinfer (3)
- # reagent (2)
- # rum (2)
- # specter (5)
- # sql (13)
- # unrepl (2)
I'm trying to use https://github.com/olahol/react-tagsinput with :npm-deps
. It doesn't get resolved in the browser, I think because the main file there has to be executed in order to provide some exports (see react-tagsinput.js
).
But if react-tagsinput.js
is mentioned in :foreign-libs
, I can use js/ReactTagsInput
with no problem, which is good.
I decided to try to use :global-exports
so that I don't have to write (def react-tagsinput js/ReactTagsInput)
or something like that:
{:file "node_modules/react-tagsinput/react-tagsinput.js"
:provides ["react-tagsinput"]
:global-exports {react-tagsinput ReactTagsInput}}
However, it doesn't work. The :global-exports
produces my_namespace.global$module$react_tagsinput = goog.global.ReactTagsInput;
and using react-tagsinput
produces my_namespace.node$module$react_tagsinput
.
Do I misunderstand the usage of :global-exports
? Or maybe there's a bug?Hmm, it also throws Error: Can't resolve 'react' in my_project/node_modules/react-tagsinput
And any attempt to debug cljsbuild result in a compilation failed by NPE.
@p-himik Global-exports is not for node modules
Hmph, thought the react-tagsinput.js file seems to be UMD module, so in this case that could be OK
But the problem with node_modules and foreign-libs is, that node_modules always take precedence so the foreign-lib entry and global-exports is not going to be used if you have node_modules dir
react-tagsinput seems to be available from Cljsjs, that would work the same as foreign-lib entry