NativeScript (+TypeScript) conditional compilation / debug / release, etc


#1

Hi all,

I’ve been playing around with NativeScript + TypeScript (but no Angular) for a few months now.

I was wondering about conditional compilation, differentiating between debug and release builds, platform defines that one can check against, etc.

TypeScript doesn’t seem to support conditional compilation (yet), which I find very strange. I think most compiled languages support this, so why not TypeScript… (but that’s obviously not NativeScript’s fault).

How do you all handle this? Are there plugins, hooks, whatever that deal with this?

Thanks,

Me :slight_smile:


#2

I’m on the same boat. With Cordova / Ionic we would do something like

gulp watch --env=dev

Is there something like that for TS / NS?


#3

You could check out nativescript-debug-production by @markosko, see if that doesn’t help your needs.

tns plugin add nativescript-hook-debug-production


#4

I’ll check it, thanks!


#5

Thanks for the tip :slight_smile: