Shadow-cljs: Leveraging the cljs bundle target

Created on 8 May 2020  路  2Comments  路  Source: thheller/shadow-cljs

With [the bundle] target, the output of the ClojureScript compiler can be immediately handed off to a JavaScript bundler like Webpack, Metro, or any other build tool that understands Node.js require. ClojureScript projects using this new target can freely integrate libraries from node_modules without handwritten externs or additional configuration, yet still fully leverage REPL-driven development and advanced compilation for the optimizable parts of their application.

What are the implications and opportunities for shadow-cljs of Clojurescript embracing javascript tools?

Related:
https://code.thheller.com/blog/shadow-cljs/2018/06/15/why-not-webpack.html
https://github.com/shadow-cljs/shadow-cljs.org/pull/26
https://clojureverse.org/t/test-drive-the-beta-clojurescript-js-bundler-integration-support/5779/5

Most helpful comment

I wrote a more detailed answer since you are not the first to ask and probably not the last.

See https://code.thheller.com/blog/shadow-cljs/2020/05/08/how-about-webpack-now.html

All 2 comments

This has no impact whatsoever for shadow-cljs. It already does a lot more. I wrote about why shadow-cljs doesn't use webpack and all of that still applies.

https://code.thheller.com/blog/shadow-cljs/2018/06/15/why-not-webpack.html

The positive change here is that more libraries will likely start to use more npm packages directly with the same syntax shadow-cljs already understands and depend less on CLJSJS packages. Although that really hasn't been much of a problem for a while. It is good that CLJS got a default way to consume npm packages directly but it doesn't affect shadow-cljs in any way. Anything :bundle can do shadow-cljs has been able to do for years.

I wrote a more detailed answer since you are not the first to ask and probably not the last.

See https://code.thheller.com/blog/shadow-cljs/2020/05/08/how-about-webpack-now.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiyinyiyong picture jiyinyiyong  路  6Comments

alex-dixon picture alex-dixon  路  5Comments

vinurs picture vinurs  路  7Comments

iku000888 picture iku000888  路  8Comments

thheller picture thheller  路  6Comments