Fork me on GitHub
#shadow-cljs
<
2020-03-21
>
knubie00:03:26

I’ve noticed that the :node-script build target requires node_modules to run, but the output from :browser doesn’t. Is it possible to make the :node-script build work like :browser such that it doesn’t need to install any node modules? For my use case I have a code base that runs in several environments; electron, browser, and node server. Most of the NPM dependencies are for the code that runs in the browser, but the node server also uses some of them when it server-side renders. When releasing the electron version those dependencies should go in "devDependencies" in the package.json so that they’re not included in the final build (the :browser build doesn’t seem to need them). However when I deploy the node server, I do need those dependencies in "dependencies" so that they’ll be installed on the server (the :node-script build seems to need them). Any ideas for the best way to configure this?

thheller08:03:25

@steedman87 you can post-process the node-script output via https://github.com/zeit/ncc or so

😍 4
🙏 8
👀 4
❤️ 4
knubie18:03:28

Awesome, thanks for the tip!

tony.kay23:03:05

@thheller I really miss the checkboxes for turning on/off builds…I have a project with 8 different targets, and depending on the task I often want to switch on/off several. The new interface makes that very tedious.

thheller23:03:42

yeah I'll add that back soon. kinda distracted at the moment.

👍 4