Fork me on GitHub
#cljs-dev
<
2018-09-26
>
bhauman14:09:20

I just hacked together extra-main support for adding a Nodejs target alongside a web target in figwheel.main, this means that I’m generating the extra bootstrap files and a main target file for Node alongside the files that are output by the compiler for a web target. In addition to this, I’ve verified that I can import npm code via a single webpack bundle (via global exports) in the web build such that the code works just fine in Node.

bhauman14:09:45

So to sum up I have a single compile process supporting both Node and Browser targets, both consuming npm modules via a webpack bundle.

bhauman14:09:59

My worry is that some Node specific things won’t compile correctly, but perhaps this isn’t a problem because they are corner cases?

dnolen23:09:11

@bhauman hrm but what’s the benefit for Node.js users? Or is this more like consolidation for the demographic of people who are doing both?

bhauman23:09:27

yes that’s what its for

bhauman23:09:33

some folks have 5 builds

bhauman23:09:03

and it makes moving between the two targets more seemless

bhauman23:09:47

but using webpack to bundle code for node is a bit odd

👍 4