문제

I need to run some "pre-build" event that generates javascript automatically,

I don't want my main app file "server.js" to be huge,

How can I execute external js files independently, and only than start the server

도움이 되었습니까?

해결책 2

or

http://gruntjs.com

although I don't know what exactly you need.

다른 팁

There is no baked in way to do it in the IDE but you can using any text editor (e.g. Sublime 3). Manually edit your njsproj file, find the line:

<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />

then add:

<PropertyGroup>
  <PreBuildEvent>
     <!-- Command stuff here -->
  </PreBuildEvent>
</PropertyGroup>

<PropertyGroup>
  <PostBuildEvent>
       <!-- Command stuff here -->
  </PostBuildEvent>
</PropertyGroup>

make sure you either unload the project in visual studio, edit and reload or leave visual studio closed until you're done editing the file.

Its kind of hacky, but it works. Its just a pain if you need to edit it as there's no tools in the IDE for it and you have to unload/edit/reload each time.

You'd have to build some kind of command to build your output to call from those event builders but it would tie them into the Build for VS.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top