Fork me on GitHub

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.


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


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


@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?


yes that’s what its for


some folks have 5 builds


and it makes moving between the two targets more seemless


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

👍 4