Is that possible compile shadow-cljs project into one single file "js-build" ["run" "-m" "shadow.cljs.devtools.cli" "release" "app"]
which command or flag could help me? (that code from project.clj file)
@sb the question is unclear. you are doing a release build which sounds like what you asked? what is the problem?
I would like to inject into one go project as frontend and for this would be great a single js file (because I need to compile into file, as fs attachment, different like in clojure)
maybe I forget the :advanced flag..
I do not understand what you are asking here
release
produces an optimized build
which is a single file
unless you declared multiples :modules
hmm interesting
ok I check again, thanks!
(assuming this is a :target :browser
) build
Sorry for this question! I check again
if the cljs-runtime
dir confuses you that is from watch
or compile
builds and is not needed in release
builds. you can optionally just clean out the :output-dir
before running the release
thanks, yes that was the problem :face_with_rolling_eyes:
you can also just use a different output-dir for release via :release {:output-dir "somewhere/else"}
see https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration
hi. We have a mixed project of cljs & ts. What needs to be considered on writing reusable react-components with ts? I guess the style-requires on ts need to be handled somehow, getting module errors on those requires with shadow-cljs.
what are style-requires? CSS I presume?
currently using sass on both sides, but I guess plain css requires (on js/ts -side) don't work either?
shadow-cljs has no support for compiling/handling CSS
you can either compile the TS to regular ES6 code and include it directly via https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js
that way the TS can see all the CLJS code and CLJS all the TS
any other method will result in either the TS code not seeing CLJS or relying on globals to wire everything together
thanks. got the ts & sass converted into js & css, but still have the css-requires in the react-components. Is there a easy way to strip those away on the js-side? e.g. the components look like this:
const Logo_1 = require("./Logo");
require("../styles/overlay.css");
const { Header, Content, Sider, Footer } = antd_1.Layout;
exports.Overlay = (props) => {
return (React.createElement(antd_1.Layout, null, ...
or is there a way for shadow-cljs not to fail on css requires? (as I can import them in my sass)
my bad, actually a typo. sorry for the extra noice.
you can let shadow-cljs ignore them via :js-options {:ignore-asset-requires true}
but it is better to just avoid them to begin with
A colleague wired up devcards and shadow-cljs; however I appear to be having some problems with the dependencies…
In particlar shadow-cljs reports shadow-cljs - failed to load module$node_modules$highlight_DOT_js$lib$core
Then some exceptions related to that
I think it’s because devcards vendors dependencies on highlight.js and marked
This commit seems relevant: https://github.com/bhauman/devcards/commit/4f02973c75586ad3f9559c044cb98585764e5199
@rickmoynihan which shadow-cljs version and which :target
?
@thheller cli version: 2.8.26 node: v13.7.0
with :target :browser
you can either upgrade or set :compiler-options {:output-feature-set :es6}
in your build config
ok I’ll try upgrading to 2.11.4
hmm actually the cli version was different to the one in my deps.edn
/ package.json
ok did yarn global add shadow-cljs
and bumped to 2.11.4
and it seems to have fixed the issue