Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use NPM modules on the client side? #23

Open
derekchiang opened this issue Jan 8, 2018 · 5 comments
Open

Is it possible to use NPM modules on the client side? #23

derekchiang opened this issue Jan 8, 2018 · 5 comments
Labels

Comments

@derekchiang
Copy link

Is it possible to use NPM modules on the client side? If so, is there an example for it?

@yogthos
Copy link
Member

yogthos commented Jan 8, 2018

Should work the same as server-side if you include them under :npm {:dependencies [...]}. There isn't an example available, but you can make a new project with the client-side support by adding the +browser flag thanks to this pr by @nenadalm.

@nenadalm
Copy link
Contributor

nenadalm commented Jan 8, 2018

@derekchiang I was playing with it yesterday and sometimes you need to create single file first: http://blob.tomerweller.com/reagent-import-react-components-from-npm.

There should be support for it in clojurescript: https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules but it's not finished yet (I was trying it with newest beta of http://www.material-ui.com/#/ and I wasn't able to configure it so that it would work. It was working only by using webpack as described in the first link).

@nenadalm
Copy link
Contributor

nenadalm commented Jan 8, 2018

@derekchiang also I don't know if you're aware of https://cljsjs.github.io/ - it contains some js libraries packaged and ready for clojurescript.

@yogthos
Copy link
Member

yogthos commented Jan 8, 2018

shadow-cljs is also worth looking at for this

@lilactown
Copy link

Yeah, my team has migrated to using shadow-cljs specifically because of it's much better consumption of NPM modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants