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


I'm trying to use 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$module$react_tagsinput =; 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


Ok, thanks for confirming.


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