question

TamsBalogh-7076 avatar image
0 Votes"
TamsBalogh-7076 asked TamsBalogh-7076 commented

How to configure NodeJS project to align with VS solution configuration?

Hi there!

I have a very simple question: how can I modify the Njsproj file to consider the currently active VS solution configuration? I have been doing research for hours but the closest thing I figured out can work is to add a C++ project built on Nan (https://github.com/nodejs/nan) to my solution that can leverage VS solution configuration. By adding this module, I could query my C++ extension whether this solution was built in 'Debug' or 'Release' mode (in C++ code itself using #if <Configuration> macros...). However, this feels like a massive overkill and surely there has to be a way to manually modify the .njsproj file to allow to consider?226475-expressapp2.txt -> I am attaching a baseline template NodeJS project generated by VS.

Why do I want to have this dependency? I want to be able to enforce certain methods only in Release mode: e.g. authentication. For now, I am going to be using the .env file to distinguish between my 'Debug' and 'Release' mode but I think the neatest would be for VS to leverage the solution configuration somehow!

I appreciate any insights!
Cheers,
Tamas Balogh



vs-debuggingvs-setupvs-msbuild
expressapp2.txt (4.4 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello, for your issue related to NodeJS project, please directly report it in Developer Community: https://developercommunity.visualstudio.com/report?space=8&entry=problem.

0 Votes 0 ·

Thank you Anna ! I was not aware of this!

0 Votes 0 ·

0 Answers