Fork me on GitHub
#re-frame
<
2018-09-02
>
andrea.crotti08:09:53

does anyone have two separate SPAs in a single app?

andrea.crotti08:09:52

I mean I didn't want to do all the routing in Clojurescript, and maybe the other page I'm writing doesn't really shared much JS code with the main page

andrea.crotti08:09:45

doesn't seem so easy though since the js is all compiled in a single app.js

henrik11:09:22

I’ve done client/server/ssr-layer as three different compilation targets (different subfolders under src). I’m not sure whether that is better or worse than entirely separate configs, but it basically comes down to which folders you tell the compiler to slurp source files from.

samueldev13:09:51

@ai20 ive got 3 SPAs running on http://bruh.io simultaneously but they’re compiled and downloaded separately

👀 4
andrea.crotti14:09:05

ah nice @samueldev the code is not available by any chance?

andrea.crotti14:09:23

and ok if I just have to make different compilation targets it should not be too hard

andrea.crotti14:09:45

I guess the different compilation targets can also share code anyway

andrea.crotti14:09:11

Closure will still kill all the unnecessary stuff anyway from each of the targets right @henrik?

henrik14:09:44

@andrea.crotti Yes, although for the SSR build, the target was Node, so conditions apply WRT Closure Compiler. For browser, sure.

henrik14:09:59

In my case, I made separate subfolders under src for browser, SSR, and shared templates. The browser build pulled from browser and templates folder, the SSR build pulled from SSR and templates folder. Worked fine.